Heteroanionic stabilization of Ni1+ with nonplanar coordination in layered nickelates