Surface plasmon-polariton study of the dielectric function of magnesium