Merged a handful of changes from netcdf-cmake branch.
Addressed the following coverity issues:

711762
711763
711766
711788
711933
711934
711935



git-svn-id: https://sub.unidata.ucar.edu/netcdf/trunk@3140 2e3060e4-1ed8-cf1f-9cc2-9586e844a556