Implement "proper" win32 locking

Windows doesn't care for attempts to statically initialize a critical
section, and the trickery to do so ("CRITICAL_SECTION cs = { NULL, -1 }";)
is extremely naughty.

So, use InterlockedCompareExchangePointer trickery.  I hope this is right.