lock: fix race in background thread when shard_num changes
lock: fix race in background thread when shard_num changes

shard_num can be unset and set to another value if we don't hold
self.lock while depending on its value. This causes a crash if the
log.error() triggers and tries to format None as an int.

Signed-off-by: Josh Durgin <51652c783f70f5b272ebd02f1fd20d3af7a2449f@inktank.com>

ceph/radosgw-agent,ceph/radosgw-agent