BF: fix reference holding onto test file

Windows was complaining about trying to delete a temporary file; delete
reference to file to allow rewriting.