Upstream some basic changes from dslomov windows branch.

The code changes are mostly due to dslomov, not me, although I refactored
the Jvm class a bit based on his changes. I set dslomov as the author.

--
Reviewed-on: https://github.com/bazelbuild/bazel/pull/688
MOS_MIGRATED_REVID=109536553
diff --git a/src/main/cpp/BUILD b/src/main/cpp/BUILD
index 09bd6a3..e6b3c74 100644
--- a/src/main/cpp/BUILD
+++ b/src/main/cpp/BUILD
@@ -21,6 +21,9 @@
             "blaze_util_freebsd.cc",
             "blaze_util_posix.cc",
         ],
+        "//src:windows": [
+            "blaze_util_mingw.cc",
+        ],
         "//conditions:default": [
             "blaze_util_linux.cc",
             "blaze_util_posix.cc",