Again MSC++RT deadlock bug: now using ExitThread() for graceful termination.