Strings::substring(): avoid calculating string length unless necessary

Minor optimization. I originally wanted to call `self::length` only when `mb_substr` is not available but as it turned out, `mb_substr` also does not handles this well in PHP < 5.4.8.
What makes it here faster and in `self::length` slower? The PHP version range?