More defensive testing of tmpdir