Fix compile error and strip newline from variable in AIX.
Merge pull request #1062 from kacfengine/master

Fix compile error and strip newline from variable in AIX.