Fix multiple sending of `end` frame.