Fix each test to run with a unique tempfile

Ongoing work to identify why tests on CRAN fails on Windows