unix, windows: validate flags on uv_udp|tcp_bind

Fixes #1247.

I'll add some tests.