Move temp-directory creation/deletion into common

My previous patches added temp directory creation and deletion into each
individual test script. I'd missed deletion in two cases, meaning your
$TMPDIR would be left with unnecessary folders on each test run.

This patch fixes that problem but also moves temp directory creation
into test_common.sh. This results in temp directory sharing across
different invocations of the same tests, simplifying matters and shaving
a little bit off the test run execution time.