Phase dependent structural and electronic properties of lanthanum orthophosphate (LaPO4)