Structural defects and microstrain in GaN induced by Mg ion implantation