Structural stability and optical properties of RENiO3 (RE = Sm, Nd and Pr) surface upon oxygen vacancy and adsorption