Merge branch 'jn/5.0.0' into maint

More fixes from the 5.0 branch:

Fix decoding of LZMA2 streams with blocks with no uncompressed data.
Taking this patch improves compatibility, while not taking this patch
would give people writing encoders a way to notice their output is
buggy.  It's too easy not to check the edge cases when writing an
encoder, so compatibility wins.

Validate encoder arguments better.  The checks that prevent NULL
pointer dereferences are not very important, but checks that avoid
producing malformed compressed output are crucial.

Fix $0 parsing in xzgrep.  xzegrep was treating its argument as a BRE,
which is just asking for subtle trouble in scripts that call it.

Thanks to Lasse Collin for advice.