yash[1] and zsh does not handle 8-bit bytes in strings good. Work around it
by using printf ... | cmp ... to compare the header. This should be 100%
posix compatible.
Also fix some of the compression header magic bytes:
- unxz: Use octal aas the string '\3757zXZ\000' was misinterpreted by some
shells.
- lzma: the third byte represents compression mode[2], and we want
support all compression modes not only '8', so we only check the first
three bytes instead of 4.
[1]: Upstream report: https://osdn.net/projects/yash/ticket/47772
[2]: https://github.com/frizb/FirmwareReverseEngineering/blob/master/IdentifyingCompressionAlgorithms.md#lzma