ESI: Ensure gzip header is always initialized (#7358)

There were certain code paths that could be reached in which
stream_finish could be called without stream_encode having been called.
This would result in the gzip header not being encoded in the stream,
which would produce malformed gzip content.
9 files changed