cf-serverd: free getaddrinfo() result, on error of OpenReceiverChannel()

getaddrinfo() may allocate the 'result' struct even in cases where it
will return an error. Take care to free memory, although we would exit
the server process anyway.
(cherry picked from commit 7472e2016626481558f0922e5e8101bc8f26e569)
cf-serverd: getaddrinfo() will use a numeric port, no lookup

This `AI_NUMERICSERV` flag avoids looking up the "services" table for
a string port resolution, according to the manual.
(cherry picked from commit 5fe15aeca4ccd7c8a8100bfa9dce552b4eedafe1)
cf-serverd: getaddrinfo() will NOT set "errno" upon failure

It has its own `gai_strerror()` function to resolve its (reentrant)
result code.
(cherry picked from commit cbff1c1afb04ae5fa84ab2dd170c901e7fdb732b)
cf-serverd: fix typo for addrinfo constant

As spotted by Dimitrios Apostolou
(cherry picked from commit 39788ff4d628ecc330dce0dbc2d3d6586259c964)
Update verify_users_pam.c

Updated for bug https://cfengine.com/dev/issues/5485 as requested by Volker Hilsheimer.
This will allow compile on NetBSD.
Tested on NetBSD i386 version 6.1.3.(cherry picked from commit 67ec36c78f8c25181a4caaafdcccbb31f2c46ca5)
Remove AI_NUMERICSERV from getaddrinfo() call.

On Windows, although defined, it is not supported by Microsoft's
network stack.
(cherry picked from commit 67f2747a60e597021401f563b30df446b1970471)
X509_gmtime_adj() and OpenSSL 0.9.8 overflow on 32-bit windows.
(cherry picked from commit 06a5ecf04a5d3cd6497042a2b85d9fa19c097cf2)
Yield cf-serverd lock at the end of its execution.
(cherry picked from commit 4960b7c1e40bc70efa696446ffe7806bbf32b4cb)
Give GenerateDiffReports access to the agent config.
(cherry picked from commit 176d10cb09ccfd066f6997a13b349601e9d3bcce)
Failing to set SO_LINGER is not a catastrophic event, do not exit.
(cherry picked from commit ea9dc564e026364003967f9aa9f3908f031a2254)
Do not log at level ERR non-catastrophic events.
(cherry picked from commit bda5cfd464c2a71e8c9a873cdbb41eb233af722a)
The caller exits, no need to do it in the callee.
(cherry picked from commit efd65c4c29f304ddb0571d03f227cdbf4aeee628)
Merge pull request #1697 from kacfengine/3.6.x_backports

3.6.x backports
Redmine#5271: pluck set_field_value

(cherry picked from commit 0c86e81b26caec135ca18f9b4d809e7d98ff6815)
Redmine#5271: do not INFORM erroneously if setting an empty field to an empty value, just note it in VERBOSE

(cherry picked from commit 454b28c6555ee04062e2e66db26c7d8e3f122474)
port of fix from 3.5.x for issue #3408 - getprocs64 on aix

(cherry picked from commit 7ada75b50e3ea724251b656d6491a81c34744184)
No change in logic, just moved things around to make more functions static.

(cherry picked from commit 92301809d5d79ef6cb40a1919cef8959d1d5778b)

Conflicts:
	cf-serverd/cf-serverd-functions.c
Introduce CF_ASSERT for debug builds.
(cherry picked from commit fcb9bb8b308443e758941e6213bc5fa6f5ee71ef)
Fix build: Remove redundant function declaration.

(cherry picked from commit 4c07869d74b7ca5126b06e9b8639c8dcd54f5df0)
Remove migration support for LMDB
(cherry picked from commit 8611970bfa33be7b3cf0724eb684833e08582850)