Fix segfault in get_until_delimiter
Port most kak scripts to be POSIX shell compliant