refs: speed up is_refname_available