Dielectronic recombination rates for ions of the magnesium sequence at low energies