rgw: off-by-one in rgw_trim_whitespace()

Fixes: #7543

Signed-off-by: Ray Lv <raylv@yahoo-inc.com>