Make HOME and TMPDIR test case-specific

Because we create a subdirectory for each of the test cases we run, try
to keep them self-contained by pointing HOME and TMPDIR to each test's
subdirectory.