strbuf: make strbuf_addftime more robust