net: refactor windows code

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4185054
3 files changed