Add pj-get-gstring that handles the C buffer overwrites