EnterCriticalSection throws exception?