move thread pool code in worker_pool

Link: https://github.com/GeneAssembly/biosal/issues/39
Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>