Add shutdown method to shutdown the thread pool.