Fix TCRM terminate on Windows