Polarity inversion of GaN(0001) by a high Mg doping