Fix method called when exiting try block

obtain() is called when the block is entered; when the block is exited,
release() is called.
Merge pull request #1068 from lucaswerkmeister/fixObtainRelease

Fix method called when exiting try block