gh-108111: Flush gzip write buffer before seeking, fixing bad writes (#108341) Co-authored-by: Ćukasz Langa <lukasz@langa.pl>