Fix for race condition in ThreadLockServiceImpl

This is the same change as that made in [pull request 47](https://github.com/uberfire/uberfire/pull/47), but for master. (PR 47 was for 0.3.x)