Fix output of invalid zip files when download is retried