A library package download whose connection died mid-transfer left
downloadAndExtractPackage's promise permanently unsettled: the error was
emitted on the un-listened Readable.from() wrapper (pipe() neither
attaches nor forwards error handlers), crashing via uncaughtException
("TypeError: terminated") while gunzip/tar never saw an error or finish.
The never-settling promise wedged a compilation queue slot forever,
which in turn permanently disabled temp dir cleanup and filled the disk
on a production instance (see #8811).
Use stream.pipeline() throughout, which propagates errors through every
stage and guarantees settlement, and per-entry pipeline for file writes
so write errors also propagate (via extract.destroy) instead of being
dropped.
The new test reproduces the production failure exactly against the old
code: an unhandled "TypeError: terminated" plus a promise that never
settles.
Fixes part of #8811.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>