hotfix: pool.terminate is more robust than pool.close which occasionally hangs if something in the child processes goes wrong.