Update file providers to close before unlinking.

This is required on windows, but the Tempfile implementation hides this
and silently ignores the error, meaning that we're leaving tempfiles
around on windows after we thought we'd cleaned them up. Eventually GC
would get to them, but this won't happen if there is a severe crash or
something calls `Kernel.exit!`, so we prefer to clean up manually.