tour: call 'done' callback after Run, on message Kind 'system'

To restore the button Run and hide the button Kill (in A Tour of Go,
not in the main Playground), writeInterceptor is expecting a call of
Kind 'end'. However, on compilation error the last call emitted has
Kind 'system'.

Fixes golang/go#50921

Change-Id: I698331e477e79fef368550d5976b5b2fc0b03e83
Reviewed-on: https://go-review.googlesource.com/c/website/+/478415
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Eno Compton <enocom@google.com>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
diff --git a/_content/js/playground.js b/_content/js/playground.js
index b23054c..5289f06 100644
--- a/_content/js/playground.js
+++ b/_content/js/playground.js
@@ -24,7 +24,7 @@
 	// The output callback is called multiple times, and each time it is
 	// passed an object of this form.
         var write = {
-                Kind: 'string', // 'start', 'stdout', 'stderr', 'end'
+                Kind: 'string', // 'start', 'stdout', 'stderr', 'end', 'system'
                 Body: 'string'  // content of write or end status message
         }
 
@@ -32,7 +32,8 @@
 	// Subsequent calls may be of Kind 'stdout' or 'stderr'
 	// and must have a non-null Body string.
 	// The final call should be of Kind 'end' with an optional
-	// Body string, signifying a failure ("killed", for example).
+	// Body string, signifying a failure ("killed", for example),
+	// or be of Kind 'system'.
 
 	// The output callback must be of this form.
 	// See PlaygroundOutput (below) for an implementation.
diff --git a/_content/tour/static/js/services.js b/_content/tour/static/js/services.js
index e5be014..42971af 100755
--- a/_content/tour/static/js/services.js
+++ b/_content/tour/static/js/services.js
@@ -45,7 +45,7 @@
                     }
                 }
                 writer(write);
-                if (write.Kind == 'end') done();
+                if (write.Kind == 'end' || write.Kind == 'system') done();
             };
         };
         return function(code, output, options, done) {