Fix hsEvent to match the old behavior better

This version of hsEvent more accurately matches the previous (Win32) behavior, and also serves as a proper binary semaphore type.  Furthermore, it is immune to the spurious awakening and potential race conditions that the unfixed C++11 version was susceptible to.