Support bzip2 and lzma/xz compressed man pages

Add support for bzip2 and lzma/xz compressed man pages.  Support for bzip2 is
part of the Python standard library (at least for 2.7 and >=3.2), while lzma/xz
is only in Python >=3.3; however, there is a backports module for Python 2.7 and
3.2.
Change an "if" to more appropriate "elif"

I overlooked an "if" that should have been an "elif". Oops.
Only try "lzma" module on ImportError
Skip lzma/xz manpages if lzma module not available

Skip man pages compressed with lzma/xz if the lzma module is not available; also
print a corresponding diagnostic message.
Only print an error when an lzma/xz manpage occurs

Only print an error when an lzma/xz compressed man page occurs. Also, use
add_diagnostic instead of print.
Change the way xz/lzma man pages are detected

This avoids the use of the global and puts the diagnostic message in a
self-contained location.
Document the optional dependency to backports.lzma.
Merge pull request #1015 from marcecj/add_bz2_lzma_xz_support

Support bzip2 and lzma/xz compressed man pages
Fix two memory leaks.
Merge remote-tracking branch 'upstream/master'