1.0dev.15: fix locking problem on Windows, add asserts to check for proper lock use