X-ray photoelectron spectroscopy measurement of valence-band offsets for Mg-based semiconductor compounds