Stress and structure at the NiO/Ag(001) interface