When cancelling a download, ensure file is closed before unlinking

Otherwise, Windows will fail with:

  Unix.Unix_error(Unix.EACCES, "unlink", "...")

Also, just log a warning if we still can't delete the temporary file.
Set close-on-exec for download channels

Seems to stop Windows seeing the download file as empty after closing
it, though I don't know why.