Fixes for console event handling on Win32 in the threaded/SMP runtime. (it now builds, but is untested).