generator: Add #ifndef defense around guestfs-internal-actions.h file.
lib: Remove explicit defines of _BSD_SOURCE.

An equivalent is defined already in <config.h>.
lib: Allow guestfs_free_* functions to be safely called with a NULL pointer.

This is so they work just like 'free'.
lib: Add CLEANUP_FREE_<struct>, CLEANUP_FREE_<struct>_LIST macros for API structs.

For example:

 {
   CLEANUP_FREE_STAT struct guestfs_stat *stat = guestfs_stat (g, "/foo");

   // stat is freed automatically when we leave the scope.
 }

The new header file "guestfs-internal-frontend-cleanups.h"
includes definitions for these.  It should not be included
directly.
lib: Use CLEANUP_FREE_<struct>, CLEANUP_FREE_<struct>_LIST macros in a few places in the library.
tools, tests: Use "guestfs-internal-frontend.h" header.

Instead of redefining STREQ, etc.
lib: Define CLEANUP_CMD_CLOSE macro and use it throughout the library.