Implement timeouts on Windows.

Makes #1664 much less acute.

--
MOS_MIGRATED_REVID=130750731
diff --git a/src/test/java/com/google/devtools/build/lib/windows/MockSubprocess.java b/src/test/java/com/google/devtools/build/lib/windows/MockSubprocess.java
index 1562532..540162c 100644
--- a/src/test/java/com/google/devtools/build/lib/windows/MockSubprocess.java
+++ b/src/test/java/com/google/devtools/build/lib/windows/MockSubprocess.java
@@ -34,6 +34,7 @@
  *   <li><code>O&lt;register&gt;</code>: Write the contents of a register to stdout</li>
  *   <li><code>E&lt;register&gt;</code>: Write the contents of a register to stderr</li>
  *   <li><code>X&lt;exit code%gt;</code>: Exit with the specified exit code</li>
+ *   <li><code>S&lt;seconds&gt;</code>: Wait the specified number of seconds</li>
  * </ul>
  *
  * <p>Registers are single characters. Each command line argument is interpreted as a single
@@ -95,6 +96,15 @@
           writeBytes(System.out, arg);
           break;
 
+        case 'W':
+          try {
+            Thread.sleep(Integer.parseInt(arg.substring(1)) * 1000);
+          } catch (InterruptedException e) {
+            // This is good enough for a mock process
+            throw new IllegalStateException(e);
+          }
+          break;
+
         case 'X':
           System.exit(Integer.parseInt(arg.substring(1)));
       }