Fix possible peer deadlock when peer completes.