utf8.c: fix strbuf_utf8_replace() consuming data beyond input string