Bug in String#end_with? resulting from incorrect length determination

There is a bug in the current implementation of String#end_with? that manifests itself under special conditions. This is very similar to the related bug I've opened as issue #1484 and opened a pull request for, so I won't repeat my explanation here. It's basically the same problem except that we're comparing at the end of the string rather than the start of the string.

As in #1484, I've committed both a test case (which failed before my fix) and a fix for the issue in the corresponding C code (where I'm skipping the comparison on strings that don't meet the length criterion).