Stress gradients in CrN coatings