Windows, JNI: correctly open stdout/stderr files
Windows, JNI: correctly open stdout/stderr files

Fix the CreateFileW open mode flags
nativeCreateProcess: FILE_APPEND_DATA was useless
without FILE_WRITE_DATA.

Really the intent is to append data to the file,
so we now open the file with GENERIC_WRITE and
seek to its end.

This change will unblock @ulfjack's pending
change [1] about LocalSpawnExecutor where he
intends to use SubprocessBuilder instead of
Command, and which is currently broken on Windows
because tests do not produce any output.

[1] https://bazel-review.googlesource.com/c/bazel/+/82975

Closes #6770.

PiperOrigin-RevId: 222959600

dslomov/bazel,twitter-forks/bazel,cushon/bazel,perezd/bazel,dslomov/bazel-windows,ulfjack/bazel,aehlig/bazel,aehlig/bazel,katre/bazel,safarmer/bazel,ulfjack/bazel,perezd/bazel,katre/bazel,bazelbuild/bazel,cushon/bazel,ulfjack/bazel,ButterflyNetwork/bazel,bazelbuild/bazel,katre/bazel,werkt/bazel,katre/bazel,ulfjack/bazel,cushon/bazel,safarmer/bazel,aehlig/bazel,safarmer/bazel,perezd/bazel,safarmer/bazel,twitter-forks/bazel,dslomov/bazel-windows,ButterflyNetwork/bazel,dslomov/bazel,perezd/bazel,aehlig/bazel,aehlig/bazel,cushon/bazel,ulfjack/bazel,safarmer/bazel,dslomov/bazel,katre/bazel,ButterflyNetwork/bazel,twitter-forks/bazel,twitter-forks/bazel,meteorcloudy/bazel,davidzchen/bazel,davidzchen/bazel,twitter-forks/bazel,dslomov/bazel-windows,dslomov/bazel-windows,werkt/bazel,davidzchen/bazel,ulfjack/bazel,davidzchen/bazel,akira-baruah/bazel,dslomov/bazel,ButterflyNetwork/bazel,ButterflyNetwork/bazel,aehlig/bazel,perezd/bazel,davidzchen/bazel,dslomov/bazel-windows,akira-baruah/bazel,ulfjack/bazel,cushon/bazel,perezd/bazel,safarmer/bazel,akira-baruah/bazel,meteorcloudy/bazel,dslomov/bazel,werkt/bazel,akira-baruah/bazel,perezd/bazel,werkt/bazel,meteorcloudy/bazel,werkt/bazel,akira-baruah/bazel,davidzchen/bazel,davidzchen/bazel,twitter-forks/bazel,dslomov/bazel,bazelbuild/bazel,meteorcloudy/bazel,meteorcloudy/bazel,ButterflyNetwork/bazel,katre/bazel,dslomov/bazel,werkt/bazel,aehlig/bazel,bazelbuild/bazel,dslomov/bazel-windows,akira-baruah/bazel,meteorcloudy/bazel,twitter-forks/bazel,meteorcloudy/bazel,bazelbuild/bazel,bazelbuild/bazel,cushon/bazel