The last character should only be skipped if a `\0` or `\n` is found. If the string ends without such a character or the maximum line length is hit, we do not skip the last character. Fixes genodelabs/genode#4985