make SocketConnectorBase less sensitive to system timing

Use Thread.join where appropriate to give the connector thread time
reasonable time to exit before checking to ensure that it exited.