Adsorption of Au and Pt dimers on Ge(001) and Si(001): A first-principles study