Electronic structure of AgNbO3 and NaNbO3 studied by X-ray photoelectron spectroscopy