Move CONNECTION_END termination after EndWrite.