p-Type conductivity of hexagonal boron nitride as a dielectrically tunable monolayer: modulation doping with magnesium