Fix Mac build.

-Turn off NaCl support for now.
-Fix compile issues in plugin code.
-Fix various code issues reported by clang.
Merge pull request #1916 from darktears/mac-build

Fix Mac build.