Socket: don't assign right endpoint until the connect is successful. (#53581)
* Socket: don't assign right endpoint until the connect is successful.
'Right endpoint' must match the address family of the Socket or
we can't serialize the LocalEndPoint and RemoteEndPoint.
When multiple connect attempts are made against a DualMode Socket with
both IPv4 and IPv6 addresses, a failed attempt must not set 'right
endpoint'.
* SocketTaskExtensionsTest.EnsureMethodsAreCallable: update expected exceptions
* PR feedback
* EnsureMethodsAreCallable: move ReceiveFromAsync before ConnectAsync to avoid wildcard bind on Windows that leads to a different exception