core: Make cmdline.Command.Main return an exit code instead of exiting.

Change-Id: Ife34378019ee25cc4d6809f1b3923a8e4f234572
MultiPart: 1/3Change-Id: Idf9bab4a66f7da4b06a12943c746b05082d69f60
diff --git a/tools/vrpc/vrpc.go b/tools/vrpc/vrpc.go
index 5c025d3..66d7b05 100644
--- a/tools/vrpc/vrpc.go
+++ b/tools/vrpc/vrpc.go
@@ -6,6 +6,7 @@
 import (
 	"fmt"
 	"io"
+	"os"
 	"strings"
 	"time"
 
@@ -31,8 +32,9 @@
 	if err != nil {
 		panic(err)
 	}
-	defer runtime.Cleanup()
-	cmdVRPC.Main()
+	exitCode := cmdVRPC.Main()
+	runtime.Cleanup()
+	os.Exit(exitCode)
 }
 
 var cmdVRPC = &cmdline.Command{