Close the file on memory and read error in Downloader::repairFile