strbuf: instate cleanup rule in case of non-memory errors