sha1_file: don't malloc the whole compressed result when writing out objects