get_ref_dir(): use a strbuf to hold refname