Confirm first if it's really the thermostat that's turning off the compressor. It could be a safety feature, cutting current to the compressor clutch if the pressure in the system is too much or too little.