Stop test suite filling /tmp

Some test files use File::Temp in such a way that the temporary files and
directories under /tmp aren't deleted at the end. On a smoker system, this
can gradually accumulate thousands of entries under /tmp.

The general culprits fixed by this commit are:

1) using tempfile() without the UNLINK => 1 argument;

2) Using Test::More (which uses Test::Stream), which creates a test
   directory in such a way that only the original parent thread will
   remove it; for some reason I still don't fully understand, detaching a
   thread rather than joining it stops this clean up happening. In the
   affected test files, I replaced the ->detach() with a ->join() just
   before exit, and the problem went away.

Some tests under cpan/ are still leaky; these will be addressed upstream.