make sure we wait for the threads to shut down before asserting closure