Optical pumping of metastable magnesium in the Mg atomic frequency standard