Interplay of intrinsic and extrinsic states in pinning and passivation of m-plane facets of GaN n-p-n junctions