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.