Influence of nonstoichiometry on the magnetic properties of Pr2NiO4 and Nd2NiO4