Bazel client, Windows: impl. server->IsStillAlive
Bazel client, Windows: impl. server->IsStillAlive

Implement proper aliveness check for the Bazel
server.

This allows detecting a server death that occurs
after the Java process started but before it
started the gRPC server.

On other platforms we open an anonymous pipe, let
the server inherit the writing end, close the
writing end in the client, and attempt to read
non-blockingly in order to check if the server is
still alive.

This approach fails on Windows because anonymous
pipes are always blocking. Named pipes support
asynchronous access but it's much simpler to just
check if the process exited. GetProcessTimes looks
like a reliable way to do so, and that's what we
use on Windows now.

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

Change-Id: Ic24577d8440eb0c8188c852e2501ce1e254ba9fd
PiperOrigin-RevId: 154283585

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