lib: Fix memory leak when the 'lpj' setting is read from dmesg.

It was failing to clean up and close the 'struct command' buffer,
because commit 94d90f03e2bbb595890b01e2a10b63e00e976691 added an
incomplete patch to use CLEANUP_CMD_CLOSE.

This fixes commit 94d90f03e2bbb595890b01e2a10b63e00e976691.
(cherry picked from commit cbfa394bfc7e980381097b457761ddc42d59d01f)
generator: Whitespace changes.
(cherry picked from commit 0e0eec76d9dca032e3eb45c0bbe024edc7bb16f8)
handle: Translatable string in guestfs_parse_environment.
(cherry picked from commit 6902f093ffd2bfbd21fcc7bc682db8106fd2fd93)
handle: Define DEFAULT_MEMSIZE, MIN_MEMSIZE constants.

This is just code motion.
(cherry picked from commit c7ba91761c05cce3806b908cba8a7a0bd902c7be)
build: Only add 'serial-tests' for automake >= 1.12 (thanks Hilko Bengen).

Earlier versions of automake complain if they get a configuration
parameter which they don't understand.  The error is:

configure.ac:27: error: option 'serial-tests' not recognized

Use some m4 hackery to work around this.
(cherry picked from commit a1c89bf03dd432f0e4c8c26fe01fd9b2a50df97e)
docs: Rewrite security section (thanks Dan Berrange).
(cherry picked from commit 065861ce6bd1069b0ae111bcd14057d82cfc3963)
faq: Add section for developers, including how to send patches and propose features.
(cherry picked from commit 175d6ba432d804c835391b52c3362b9bbc3eccae)
rescue: Improve error messages in the test script.
(cherry picked from commit b10a6cfe24a20d59d6eb099454761f71573f478d)
lib: Use CLEANUP_* macros to simplify XPath query code.
(cherry picked from commit 61162bdce1a00a921a47eb3e788e8fb9e4bd07ac)
tests: Add valgrind suppression variant for new manifestation of an old libvirt memory leak.
(cherry picked from commit b7ab6de628936868ce676820a3871cbf4d6ac372)
tests: Add valgrind suppression for libvirt 1.0.2 memory leak.

Leak reported as RHBZ#913145.
(cherry picked from commit 6566621345a46d5514565b59cc2889c1c4583169)
build: Rearrange src/Makefile.am into a more logical order.

This is just code motion.
(cherry picked from commit 21013249659931aea326bd2a3f1ed1753b309963)
build: Remove long and mostly irrelevant comment about libtool versioning.
(cherry picked from commit 1a2465c187e53ac26128cfdd9bcaae19475e2d0d)
lib: Rename guestfs_error_errno as guestfs___error_errno, etc.

These are internal functions.  Very old versions of libguestfs used to
export them, but they haven't been (and shouldn't be) exported for a
long time.

Also remove the unused guestfs_error function.
(cherry picked from commit a4953090e1515fed7a1c0945316435043740f7f2)
lib: Create libutils convenience library.

The libutils convenience library is a place for code shared between
the main library, language bindings and virt tools.  Note that the
code is statically linked into both the library, each binding and each
tool, but this is an improvement because (a) the source is shared and
(b) libguestfs.so can export fewer private functions.

Currently it contains the cleanup functions, and the functions
guestfs___free_string_list function and guestfs___for_each_disk.

guestfs___for_each_disk has changed so that it no longer
unconditionally sets the error in the guestfs handle.  Instead callers
can control error handling.
(cherry picked from commit 04723b4dd105d204b5afa7201860c9a81eda05b2)
erlang: Use guestfs___free_string_list from libutils, instead of custom version.
(cherry picked from commit 7ef461948ec79608e43166ba897338ea69041c47)
libutils: Add guestfs___count_strings utility function to common library.
(cherry picked from commit e27295c5780c1b42610f56be9082bb81f27f6fcd)
fish: Use guestfs___{free_string_list,count_strings} utility functions.

Instead of custom-coded versions.
(cherry picked from commit 0b7acf50b69cbc45b740f05115cbf44c232fae08)
lua: Use guestfs___free_string_list instead of custom-coded version.
(cherry picked from commit 27e6347b759fc824f911835e7908f4daf7b3654f)
ocaml: Missing #include <config.h> in generated file.
(cherry picked from commit 6ee164d47ae29ad16b6184f8020841f860d93798)