Added destructor to thread pool.