Miscellaneous things caught by clang-analyzer.

Just learned about this:

http://clang-analyzer.llvm.org/

It found a few things.  Also a few false positives because it doesn't quite grok how Python exceptions work.

It totally goes crazy over cfitsio, but as an external project, I left those alone.