va_arg is not well-defined for shorter-than-int arguments

Use int instead of mode_t, as the latter is either int or short
(cherry picked from commit e471bfd58655521fbb5474b49ec85ece174eeee7)
Add missing platform header for HP-UX.

The code compiles without it, but gets the wrong definition of stat
on HP-UX
(cherry picked from commit 6f2025af92da86c70af6e0d67bf6faa187838233)
Merge pull request #1127 from kacfengine/3.5.x

[3.5.x] Fixes for HP-UX.
Fix broken safe_open() when path contains double slashes.
(cherry picked from commit ed36f31a54950a2778f380a9c3606502120ba647)
Merge pull request #1130 from kacfengine/3.5.x

[3.5.x] Fix broken safe_open() when path contains double slashes.
Fix compilation on Solaris 11.

The DATA_TYPE_STRING enum value is defined in their zone.h file, but
we also use it in evaluation code, so compile these functions in a
separate file that doesn't include cf3.defs.h.

Fixes issue #3472.

Back-port of 5e24267e7d045ab7cf70b17dd3f927667d90476c for 3.5.3.
Conflicts resolved in:
	libpromises/Makefile.am
	libpromises/processes_select.c
Merge pull request #1132 from ediosyncratic/RM3472-solaris-compile-fix

3.5.x (RM #3472): Fix compilation on Solaris 11.
Merge pull request #1090 from McAtte/3.5.x-fix-3644

 [3.5.x] remove extraneous text from bootstrap message - fix #3644
Update version info in promises.cf and update.cf
Merge pull request #1139 from awsiv/3.5.x

Update version info in promises.cf and update.cf
Added safe wrappers to creat, chown, lchown and chmod.

To prevent race conditions in path lookup when we change attributes.

Continuation of issue #3693.
(cherry picked from commit 8e9b258aaead20584c18709932cf3bd3b7613712)

Conflicts:

	libcompat/fstatat.c
	libcompat/openat.c
	libpromises/files_copy.c
Merge pull request #1142 from kacfengine/safe_stuff_3.5.x

[3.5.x] Added safe wrappers to creat, chown, lchown and chmod.
Remove leftover comment.
Fix cf-serverd not reloading policies when they have changed.

The root of the problem was that the code to check for updated
promises was shared between cf-agent/cf-promises and the daemons, but
they have different semantics. cf-agent/cf-promises need to check
whether any files have changed so they can update
cf_promises_validated. To do this, a check that compares
cf_promises_validated to each file in inputs is needed, which is what
the existing code is doing.

The daemons however, need to compare the modification time of
cf_promises_validated against the time that they last reloaded the
policies, which is a value that should be kept in memory.

This was fixed by running a simple stat in the daemons and comparing
that to the time of the last seen cf_promises_validated. Also made
sure that cf-agent is the only one updating the cf_promises_validated
file. It's not the daemons' responsibility to do this.

Redmine #3809.
Merge pull request #1152 from kacfengine/policy_reload_fix

Fix cf-serverd not reloading policies when they have changed.
Added ChangeLog entry.
Merge branch '3.5.x' of github.com:cfengine/core into 3.5.x