Fix method called when exiting try block

`obtain()` is called when the block is entered; when the block is exited, `release()` is called.