ensure unlock in case of exception
Merge pull request #15 from stangel/patch-1

ensure unlock in case of exception