fix off-by-one error in String#rindex(fixnum)

null-terminated string should not be included in search targets.
Merge pull request #1795 from cubicdaiya/issues/off_by_one_error

fix off-by-one error in String#rindex(fixnum)