Bazel client, Windows: fix server kill failures
Bazel client, Windows: fix server kill failures

Fix the (spurious) error messages about the Bazel
client's failure to kill the server process, with
"Access Denied" errors.

This was caused by our attempt to kill the server
process twice, and the error was coming from the
second attempt.

The culprit was an unimplemented
VerifyServerProcess method (which ensures that the
PID read from the server.pid.txt indeed refers to
a running Bazel server) which always returned
false, to avoid accidentally killing an unrelated
process that got the same PID as the last alive
Bazel server.

The new code follows the same logic as the Linux
version of Bazel, namely storing the process'
start time in a file next to the PID file, and
checking that the process with said PID was
indeed started at the time we read from the file.

This change also fixes a problem that the now
working VerifyServerProcess uncovered: we need to
wait for the previous Bazel server to properly
shut down before we can open the new jvm.out log
file.

Fixes https://github.com/bazelbuild/bazel/issues/2684

--
PiperOrigin-RevId: 150632429
MOS_MIGRATED_REVID=150632429

dslomov/bazel-windows,ulfjack/bazel,davidzchen/bazel,snnn/bazel,variac/bazel,ButterflyNetwork/bazel,aehlig/bazel,juhalindfors/bazel-patches,akira-baruah/bazel,meteorcloudy/bazel,werkt/bazel,meteorcloudy/bazel,dslomov/bazel-windows,akira-baruah/bazel,twitter-forks/bazel,snnn/bazel,spxtr/bazel,akira-baruah/bazel,meteorcloudy/bazel,dropbox/bazel,ulfjack/bazel,dslomov/bazel,twitter-forks/bazel,damienmg/bazel,juhalindfors/bazel-patches,dslomov/bazel,juhalindfors/bazel-patches,aehlig/bazel,safarmer/bazel,perezd/bazel,safarmer/bazel,dslomov/bazel-windows,dropbox/bazel,aehlig/bazel,davidzchen/bazel,spxtr/bazel,ButterflyNetwork/bazel,ulfjack/bazel,dslomov/bazel-windows,cushon/bazel,cushon/bazel,juhalindfors/bazel-patches,davidzchen/bazel,akira-baruah/bazel,perezd/bazel,aehlig/bazel,bazelbuild/bazel,werkt/bazel,davidzchen/bazel,perezd/bazel,perezd/bazel,dropbox/bazel,meteorcloudy/bazel,werkt/bazel,katre/bazel,variac/bazel,perezd/bazel,safarmer/bazel,cushon/bazel,damienmg/bazel,ButterflyNetwork/bazel,perezd/bazel,akira-baruah/bazel,juhalindfors/bazel-patches,bazelbuild/bazel,dropbox/bazel,werkt/bazel,katre/bazel,spxtr/bazel,akira-baruah/bazel,dslomov/bazel-windows,ButterflyNetwork/bazel,juhalindfors/bazel-patches,variac/bazel,davidzchen/bazel,spxtr/bazel,twitter-forks/bazel,ulfjack/bazel,werkt/bazel,snnn/bazel,dropbox/bazel,ButterflyNetwork/bazel,safarmer/bazel,aehlig/bazel,damienmg/bazel,spxtr/bazel,katre/bazel,dslomov/bazel,bazelbuild/bazel,damienmg/bazel,variac/bazel,cushon/bazel,ulfjack/bazel,werkt/bazel,dslomov/bazel,ulfjack/bazel,meteorcloudy/bazel,katre/bazel,ulfjack/bazel,perezd/bazel,twitter-forks/bazel,variac/bazel,damienmg/bazel,twitter-forks/bazel,safarmer/bazel,spxtr/bazel,snnn/bazel,cushon/bazel,meteorcloudy/bazel,katre/bazel,dropbox/bazel,meteorcloudy/bazel,snnn/bazel,twitter-forks/bazel,cushon/bazel,spxtr/bazel,bazelbuild/bazel,katre/bazel,dslomov/bazel,snnn/bazel,variac/bazel,aehlig/bazel,bazelbuild/bazel,bazelbuild/bazel,dslomov/bazel,snnn/bazel,variac/bazel,aehlig/bazel,juhalindfors/bazel-patches,dslomov/bazel-windows,twitter-forks/bazel,davidzchen/bazel,davidzchen/bazel,ButterflyNetwork/bazel,damienmg/bazel,safarmer/bazel,damienmg/bazel,dslomov/bazel