Make Windows process management nicer.

Subprocesses now get killed if the Bazel server itself is killed and so do their subprocesses.

Also implemented Subprocess#close() so that we get a little more control over when the native structures are cleaned up.

--
MOS_MIGRATED_REVID=126628000
diff --git a/src/main/java/com/google/devtools/build/lib/shell/Subprocess.java b/src/main/java/com/google/devtools/build/lib/shell/Subprocess.java
index f8a8a55..e5710e7 100644
--- a/src/main/java/com/google/devtools/build/lib/shell/Subprocess.java
+++ b/src/main/java/com/google/devtools/build/lib/shell/Subprocess.java
@@ -14,6 +14,7 @@
 
 package com.google.devtools.build.lib.shell;
 
+import java.io.Closeable;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -21,7 +22,7 @@
 /**
  * A process started by Bazel.
  */
-public interface Subprocess {
+public interface Subprocess extends Closeable {
 
   /**
    * Something that can create subprocesses.
@@ -70,4 +71,11 @@
    * Returns a stream from which the stderr of the process can be read.
    */
   InputStream getErrorStream();
+
+  /*
+   * Terminates the process as thoroughly as the underlying implementation allows and releases
+   * native data structures associated with the process.
+   */
+  @Override
+  void close();
 }