WinMain: Use the correct function to close the event handle