os: another attempt to handle OpenFile flag parameter properly on Windows

Fixes #1791.

R=rsc, r, r, iant
CC=golang-dev
https://golang.org/cl/4551046
2 files changed