Femtosecond coherent control of thermal photoassociation of magnesium atoms.