rgw: PutObjMetadata, clear bufferlist before appending into it

Fixes: #9576
Backport: firefly, dumpling

We need to completely rewrite the bufferlist, not append into it.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
rgw: rados->set_attrs() updates bucket index

Fixes: #5595
Backport: dumpling, firefly
We need to update the bucket index when updating object attrs, otherwise
we're missing meta changes that need to be registered. It also
solves issue of bucket index not knowing about object acl changes,
although this one still requires some more work.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Merge pull request #2562 from ceph/wip-5595

Wip 5595

Reviewed-by: Josh Durgin <jdurgin@redhat.com>