Restore creation of zero-length files (the pre-pipeline code opened the
write stream before the size check, so empty files appeared on disk;
the refactor dropped them), but only for regular file entries — the old
code would also have created a stray file for directory entries.
Harden the zip-slip check against prefix collisions (/tmp/pkg vs
/tmp/pkg-evil) using path.relative, and test both behaviours.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>