Surface structures and defect properties of pure and doped La2NiO4