Allow ThreadPool to be configured with an arbitrary number of threads.

Maybe add a ```CHECK_GT(num_threads, 0)```?