Update pet2tgz

Avoid temp files; make simpler. I've tested with both head/tail from coreutils and busybox.

Sorry about submitting to master originally.