Some new fixes for gcc and cppcheck warnings/issues

Includes correct fixes to silence 'gcc -Wunused-variable' issues from https://github.com/ceph/ceph/pull/1916