Significant mutability fixes for compression

Ran into an annoying issue with mutable borrowing. Until miniz can be
restructured, _borrow_temp is used to work around it.