Electronic structure of pristine and Ni-substituted LaFeO3 from near edge x-ray absorption fine structure experiments and first-principles simulations