Fix several CID issues - v2

Updated version of pull request #469. Dropped two patches which needs to be reworked (test_rgw_admin_log.cc and  rbd_fuse/rbd-fuse.c).
-------
- close some memory/resource leaks
- remove empty lines (not CID)