Use ConnectEx where available.

N.B. This change conservatively limits the use of ConnectEx to
connection-oriented IP sockets.