Fix index out of bounds with rtrim().
Fix index out of bounds with rtrim().

Change-Id: I8c420a45aacdb0ce8f6a83fa8cdf5e91b8ef1f77
Reviewed-on: http://gerrit.ent.cloudera.com:8080/3268
Reviewed-by: Nong Li <99a5e5f8f5911755b88e0b536d46aafa102bed41@cloudera.com>
Tested-by: jenkins

michaelhkw/incubator-impala,michaelhkw/incubator-impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,cloudera/Impala