unix, windows: validate flags on uv_udp|tcp_bind

fixes #1247
windows: fix build error

Previously using Windows DevKit 8.1
`tcp.c(250): error C2275: 'SOCKET' : illegal use of this type as an
expression`