add km_readline_realloc: a nicer readline + tests