Why does this Threadpool Deadlock upon Descruction? What could be the problem with the following threadpool implementation?