fix CMakeLists.txt to work with cmake-2.x

cmake-2.8 did not recognize the '!' expression and thus trying to
build the windows-branch on unix.
fix undeclared use of osexit() in platform_*.c

clang complaints (rightfully so) about the missing declaration of
osexit().