Fix trailing whitespace in zip files
undo free bsd error handling
address feedback
fix range
Land #1859, fix trailing newlines in zip.

This incidentally fixes #1755 for real, where most of the discussion
of this bug took place.