Relation Between Residual Stresses and Adhesion of Hard Coatings