Strip test-group name, removing any '\r' present.

Allows tests to run at all on Windows.
Thread-related fixes.

Printing a single string allows for atomicity. The comma seems to result
in different prints and screwed-up output. Also joining all threads to
prevent an exception from being thrown when a thread is still running on
shutdown.