Fix a mistake in connect/listen error handling (due to change in UV API)

As a pull request because this exposes a problem during the tests. Not sure what the exact issue is, but wanted to make sure this doesn't get lost.