Bugfixes osx

Assorted bugfixes to make CFEngine compilable on OS X again.