VirtualSocketServer out-of-order issue with closing TCP sockets

https://webrtc-codereview.appspot.com/41449004 added a TURN TCP
allocation release test which was disabled as it triggered an assert
in the turnserver.

This was caused by VirtualSockerServer delivering the last TCP packet
after closing the connection. Calling
    VirtualSocketServer::SendTcp
and
    VirtualSocket::Close
from TestTurnTCPReleaseAllocation led to the following order of
messages in VirtualSocket::OnMessage:
    MSG_ID_DISCONNECT
    MSG_ID_PACKET

This is out of order and triggers an assert in turnserver.cc since the
socket from which the message arrives has already been discarded,
subsequently breaking the test.

In VirtualSocketServer::Disconnect the MSG_ID_DISCONNECT is posted to the
msg_queue immediately, thus getting ahead of any (slightly delayed)
actual packets.

Maybe PostAt(network_delay_ + 1, ...) would be better?

Re-enables TestTurnTCPReleaseAllocation.

BUG=
R=juberti@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34759004

Cr-Commit-Position: refs/heads/master@{#8271}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8271 4adac7df-926f-26a2-2b94-8c16560cd09d
2 files changed