veyron/lib/modules: fix a test -race problem.

Closing a pipe which has an outstanding read leads a -race failure.
This is unavoidable given the underlying UNIX API, so we work around
it by using sycall.Close on the file descriptor rather than the Close
method on the io.Closer interface.

Change-Id: If576b549a36c9e1fd4cd7daa0d270e7c21e43a38
diff --git a/lib/modules/shell.go b/lib/modules/shell.go
index 09941b8..4df120b 100644
--- a/lib/modules/shell.go
+++ b/lib/modules/shell.go
@@ -39,6 +39,7 @@
 	"bufio"
 	"fmt"
 	"io"
+	"strings"
 	"sync"
 
 	"veyron2/vlog"
@@ -104,10 +105,10 @@
 	sh.mu.Lock()
 	defer sh.mu.Unlock()
 	h := ""
-	for _, c := range sh.cmds {
-		h += c.help
+	for n, _ := range sh.cmds {
+		h += n + ", "
 	}
-	return h
+	return strings.TrimRight(h, ", ")
 }
 
 // Help returns the help message for the specified command.
@@ -115,7 +116,7 @@
 	sh.mu.Lock()
 	defer sh.mu.Unlock()
 	if c := sh.cmds[command]; c != nil {
-		return c.help
+		return command + ": " + c.help
 	}
 	return ""
 }
@@ -236,3 +237,12 @@
 type command interface {
 	start(sh *Shell, args ...string) (Handle, error)
 }
+
+func WaitForEOF(stdin io.Reader) {
+	buf := [1024]byte{}
+	for {
+		if _, err := stdin.Read(buf[:]); err == io.EOF {
+			return
+		}
+	}
+}