Only check for ninja stuckness after it's been running for a bit

Bug: 62580037
Test: rm -rf out && m -j showcommands | grep "ninja may be stuck" || echo ok

Change-Id: I8ff1bd216b5f8349ce9e06e5465a9f8d0663f8c0
diff --git a/ui/build/exec.go b/ui/build/exec.go
index 79310dc..90fb19d 100644
--- a/ui/build/exec.go
+++ b/ui/build/exec.go
@@ -30,9 +30,6 @@
 	ctx    Context
 	config Config
 	name   string
-
-	// doneChannel closes to signal the command's termination
-	doneChannel chan bool
 }
 
 func Command(ctx Context, config Config, name string, executable string, args ...string) *Cmd {
@@ -41,10 +38,9 @@
 		Environment: config.Environment().Copy(),
 		Sandbox:     noSandbox,
 
-		ctx:         ctx,
-		config:      config,
-		name:        name,
-		doneChannel: make(chan bool),
+		ctx:    ctx,
+		config: config,
+		name:   name,
 	}
 
 	return ret
@@ -61,10 +57,6 @@
 	c.ctx.Verboseln(c.Path, c.Args)
 }
 
-func (c *Cmd) teardown() {
-	close(c.doneChannel)
-}
-
 func (c *Cmd) Start() error {
 	c.prepare()
 	return c.Cmd.Start()
@@ -72,21 +64,18 @@
 
 func (c *Cmd) Run() error {
 	c.prepare()
-	defer c.teardown()
 	err := c.Cmd.Run()
 	return err
 }
 
 func (c *Cmd) Output() ([]byte, error) {
 	c.prepare()
-	defer c.teardown()
 	bytes, err := c.Cmd.Output()
 	return bytes, err
 }
 
 func (c *Cmd) CombinedOutput() ([]byte, error) {
 	c.prepare()
-	defer c.teardown()
 	bytes, err := c.Cmd.CombinedOutput()
 	return bytes, err
 }
@@ -133,13 +122,3 @@
 	c.reportError(err)
 	return ret
 }
-
-// Done() tells whether this command has finished executing
-func (c *Cmd) Done() bool {
-	select {
-	case <-c.doneChannel:
-		return true
-	default:
-		return false
-	}
-}