do_fetch(): clean up existing_refs before exiting