ThreadPool: print an error when hanging