Add stop() and join() functions to thread_pool.