Delay destroying a port if new connections are created and destroyed.

If all connections on a port is destroyed, it will schedule an event
to check if it is dead after a timeout. Previously if a new connection
is created but destroyed before the event is fired, it will destroy the
port. With this change, we will not destoy it until it times out again
after the last created connection is destroyed.

BUG=
R=pthatcher@webrtc.org, zhihuang@webrtc.org

Review URL: https://codereview.webrtc.org/2184013003 .

Cr-Original-Commit-Position: refs/heads/master@{#13563}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: b5db1ec0e5760e370c2afe7e4171a9128039ae53
3 files changed