Effect of the intermediate principal stress on the failure of a foliated anisotropic rock