SingleLock: using try/finally to release the lock