Redmine #5211: Detect broken strndup on AIX and provide workaround.

This fixes some *very* elusive crashes, that happen pretty much
anywhere in CFEngine, the reason is that strndup(src, n) on AIX has a
bug which allocates memory for strlen(src), but it will *write* n
bytes, so whenever n > strlen(src) you get memory corruption.