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

Minor optimization. I was 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.