win32: add window locks around drawing and events