The isotopic composition of magnesium in the inner Solar System