Quasiharmonic elastic constants corrected for deviatoric thermal stresses