fix wrong String.split_at/2 output when second arg is not an integer

This fixed issue #2874.