Simple thread pool class, using pthreads.