Possible fix for worker thread issue

Removed some locks from UniqueQueue and changed the deque to a Queue.
It doesn't seem quite like the way it should be done, but it does seem to work.