Better cleanup of tempfile.mkdtemp directories in tests