fetch: plug two leaks on error exit in store_updated_refs