Fixed race caused by resetting connection manager in dispatcher before
threads currently running inside dispatcher are done.
Rewrote Transport::ConnectToBootstrapEndpoint and Transport::DetectNatType to no longer be racy.
Cleared all remaining easily repeatable races in TESTrudp. We still need to 24 hour soak test to find
any races which only very rarely turn up, but now TESTrudp ought to be far more stable and reliable.
Replaced use of lambda with defaulted argument as MSVC + GCC wouldn't accept it.
Fixed race in my own race fix earlier committed. Sigh.
Replaced shared_ptr(new) construction with make_shared.
Fixed segfault randomly generated in ConnectToBootstrapEndpoint.
Restored some of the locking semantics in ConnectToBootstrapEndpoint from previous code to see if it makes a difference to the segfaults (I see none here after 10x iteration of TESTrouting_api).
Traced backwards through the OnConnectionAdded and OnConnectionLost strand chain and I have no
idea why the mutex fix is necessary. Added note to say so.
Put a TEMPORARY static mutex around Connection::HandleTick() to see what happens on the CI stability.
Replace global static lock on HandleTick with a per-connection mutex + assert if two HandleTicks occur at once.