Optimize `ft_substr` to malloc the exact size for when length given is larger than the source string.