Ab initio calculation of muon capture on Mg24