ConnectBG handles asynchronous connects by spinning up a background thread to call ::connect(). We kick that thread out of connect, after a timeout, by calling close. This isn't safe because:
Which can lead us to connect a fd to the wrong endpoint.
We can work around this by only calling shutdown from the parent thread, waiting for the child to join, then calling close.