how does a thermocouple work on a gas valve