Fix windows test issue: close file log before removing

You can't remove a file that's currently opened in windows
so we have an explicit cleanup step that closes the file first.