rgw: a few fixes, don't hold lock while flushing

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>