rgw: change RGWOp::name() to return string instead of char*

Return 'const string' instead of 'const char *' from RGWOp::name() to
avoid the usage of std::string:c_str() to return 'const char *' in
some cases in rgw_rest_replica_log.h.

Returning result of c_str() from a function is dangerous since the
result gets (may) invalid after the related string object gets
destroyed or out of scope (which is the case with return). So you
may end up with garbage in this case.

Related warning from cppcheck:
 [src/rgw/rgw_rest_replica_log.h:39]: (error) Dangerous usage of
  c_str(). The value returned by c_str() is invalid after this call.
 [src/rgw/rgw_rest_replica_log.h:59]: (error) Dangerous usage of
  c_str(). The value returned by c_str() is invalid after this call.
 [src/rgw/rgw_rest_replica_log.h:79]: (error) Dangerous usage of
  c_str(). The value returned by c_str() is invalid after this call

This should also fix:

CID 1049250 (#1 of 1): Wrapper object use after free (WRAPPER_ESCAPE)
  escape: The internal representation of "s" escapes, but is destroyed
  when it exits scope.
CID 1049251 (#1 of 1): Wrapper object use after free (WRAPPER_ESCAPE)
  escape: The internal representation of "s" escapes, but is destroyed
  when it exits scope.
CID 1049252 (#1 of 1): Wrapper object use after free (WRAPPER_ESCAPE)
  escape: The internal representation of "s" escapes, but is destroyed
  when it exits scope.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_metadata.cc: use static_cast<>() instead of C-Style cast

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_cls_version.cc: don't free object twice, free the right one

Object 'librados::ObjectWriteOperation *op' is freed twice in the TEST
test_version_inc_read. Free instead 'librados::ObjectReadOperation *rop'

Related cppcheck warning:
 [src/test/cls_version/test_cls_version.cc:79]: (error) Memory
  pointed to by 'op' is freed twice.

This should also fix:

CID 1049247 (#1 of 1): Use after free (USE_AFTER_FREE)
  deref_arg: Calling "librados::ObjectWriteOperation::~ObjectWriteOperation()"
  dereferences freed pointer "op". (The dereference happens because this is
  a virtual function call.)
CID 1049218 (#4 of 4): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "rop" going out of scope leaks the storage it
  points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_bucket.cc: use static_cast<>() instead of C-Style cast

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mon/PGMonitor.cc: reduce scope of local 'num_slow_osds' variable

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
cls_replica_log_types.h: pass const std::list<> by reference

Pass  const std::list<> parameter by refrence to
cls_replica_log_progress_marker().

From cppcheck:
 [src/cls/replica_log/cls_replica_log_types.h:64]: (performance)
  Function parameter 'b' should be passed by reference.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Merge pull request #453 from dalgaaf/wip-da-SCA-cppcheck-7

Fix SCA and CID issues

Reviewed-by: Sage Weil <sage@inktank.com>