Fix test on Windows.

Windows complains of invalid parameters because the socket is not bound.
The test expected the error to be EAGAIN/EWOULDBLOCK. Moved the call down,
after the socket is bound.