rgw: trivial cleanups post code review

Following code review of #4760.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: fix bucket count when stating account

We need to add up the num of buckets and not just set it
as we don't read the entire list of buckets in one operation.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: fix plain formatter flush

The plain formatter flush needs to append eol if needed, and
not to clear the sections stack.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: swift list containers can return 204

In order to keep compatibility with swift, if a plain formatter
is being used, we should return 204 when there are no containers.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: fix bucket listing when reaching limit

Bucket listing was broken when limit was set.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: fix list buckets limit

There was an issue when limit was being set, we didn't
break from the iterating loop if limit was reached. Also,
S3 does not enforce any limit, so keep that behavior.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: fix compilation for certain architectures

Casting.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Merge branch 'wip-4760' into next