Measurements of cross sections for the formation of Mg2+ ions by collisions between protons and Mg+