fix false positive case in String#end_with?

- also, improve the efficiency of the check
Merge pull request #269 from mojavelinux/end-with-fix

fix false positive case in String#end_with?