Stoichiometry in Ti-N barrier layers studied by x-ray emission spectroscopy