Thermostatic water heater