Make sure test runner exits, even if the test class threw an exception

If a test class fails in a static initialiser then the test runner hangs.