X-ray analysis of residual stress gradients in TiN coatings by a Laplace space approach and cross-sectional nanodiffraction: a critical comparison