replaced buggy lock test that relied on sleeps to try and ensure
a specific ordering of lock acquirement and release.
release lock in a finally.
Merge pull request #339 from continuuity/feature/fix-lock-test

replaced buggy lock test that relied on sleeps to try and ensure