A simple approach to temperature dependence of strain energy: Application to GaN-based semiconductors