Windows: ensure TreeLock obtain and release same pointer