build: use the ptsname_r gnulib module

virt-p2v uses ptsname_r, which is not portable but implemented by
gnulib.
Include string.h where needed

Required for using strlen, memcpy, etc. Apparently implicitly pulled so
far.
Include sys/wait.h where needed

Required for using WIFEXITED, WEXITSTATUS, etc. Apparently implicitly
pulled so far.
build: look for and use sys/endian.h

Some OSes have sys/endian.h instead of glibc's endian.h.
fuse: test-fuse: enclose acl vars within HAVE_ACL

Enclose the acl-related variables within a #ifdef HAVE_ACL block, so
when building without acl support and -Werror it can build.
p2v: remove unused variable
normalize iconv handling

Since the signature of iconv() changes between implementations (the
constness of the second parameter, in particular), make use of the iconv
module of gnulib to handle these potential differences, including an
external (out of libc) iconv implementation.
builder: rename "program_name" into "progname"

"program_name" is already used as shorthand define for
program_invocation_short_name.
tests: isolate iso_system_id baseline string

Move the reference iso_system_id for the isoinfo_device test to an own
define for Linux, with an error for unknown OSes.
Include stdint.h where needed

Required for using int64_t, etc. Apparently implicitly pulled so far.
build: use $(SED) instead of sed when possible

Make use of the sed executable set at configure time.
tests/c-api: add a way to skip test when host and appliance differ

Add a IfNotCrossAppliance prereq for tests, so a test using it can only
be run when the appliance is a copy of the running host system; this can
help marking tests which run stuff (usually built in the host) inside
the appliance.
actions: mark as IfNotCrossAppliance tests of command and command_lines

All these tests copy to the appliance a tool built on the host, and run
it.
customize, mllib: use the libvirt CFLAGS

uri-c.c and perl_edit-c.c end up (directly or indirectly) including
guestfs-internal-frontend.h, which in turns includes libvirt/libvirt.h;
hence, make sure to use the libvirt CFLAGS.
tests: switch from get_current_dir_name to getcwd(0, NULL)

get_current_dir_name exists on GNU libc only, so not portable.
On the other hand, while POSIX leaves a null buffer argument for getcwd
as unspecified behaviour, basically the most used/important Unix
implementations (GNU libc, FreeBSD's libc, etc) allow such value,
returning a new allocated buffer with the current directory.

In any case, the change just affects two tests, so even if it hits a
libc not implementing this behaviour for getcwd, only tests are
affected.
configure: map also amd64 as host_cpu to x86_64 qemu