Explicitly disable/enable dualstack depending on presence of flag set by uv_tcp_dualstack() function.
Fix a bug that was introduced in commit 3ee4d3f ("unix, windows: return error codes directly") and add a regression test for good measure. Hat tip to Fedor for pointing out the issue. Fixes #1007.
3ee4d3f