Laser spectroscopic study of Mg atoms in pressurized liquid helium