grep: use return value of strbuf_detach()