Make sure close frame is only sent once