create buildpack cache file only if downloaded

Previously a failed download would leave an empty file in place of the
tarball, which would later fail to unpack. This changes it to only
create the file if the download succeeds.

[finishes #58571584]