Control of Mg doping of GaN in RF-plasma molecular beam epitaxy