Stoping A* as soon as a candidate is found.