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