Fixed a crash that could occur if a unit test case's class setup or teardown methods raised an exception.
Explicitly terminating and joining pools after we have finished, which makes it much easier to clean up after unit tests that exercise subprocesses on Windows.