Fix most of, if not all, of the cppcheck warnings.

Refs #9970