Fix threadpool testing errors

https://docs.python.org/3.2/library/concurrent.futures.html#concurrent.futures.Executor.shutdown