Don't join threads that are already dead.

Refs #4990
Add missing newlines.

Refs #4990