fix clang-analyzer warnings

Reviewer: trivial

Clang 3.4 added a few new checks. Most of the warnings were in submodules. This
gets the build clean on Ubuntu 14.04.