Fix: __exit__ doesn't release lock