fix(tooling): fix #3246 (#3737)

zstd.Writer is based on the zstd streaming API.  From https://facebook.github.io/zstd/zstd_manual.html:

> - ZSTD_compressContinue() presumes prior input ***is still accessible and unmodified*** (up to maximum distance size, see WindowLog).

The Riegeli Writer cannot uphold this precondition of the zstd streaming
API. Go's GC may collect any input buffer when no longer used by the
client; it cannot see the usage in the C library.

Instead, buffer and compress each zstd chunk individually without
relying on the streaming API.
1 file changed