O K-edge x-ray absorption study of ultrathin NiO epilayers deposited in situ on Ag(001)