Nitrogen doping and thermal stability in HfSiOxNy studied by photoemission and x-ray absorption spectroscopy