Inversion of wurtzite GaN(0001) by exposure to magnesium