Added some cleanup code to ~ThreadPool