Thermal switch for the control of heat flow