refs.c: upgrade for_each_replace_ref to be a each_repo_ref_fn callback