Impact of residual stress on adhesion and tensile fracture of TiN/CrN multilayered coatings from first principles