A simple explanation for the evolution and maintenance of temperature-dependent sex determination