syncbase/vsync: closing discovery channel

Fix a bug in the neighborhood peer-discovery scanner.  When the context
is cancelled during Syncbase shutdown, the discovery channel is closed.
Detect that and terminate the neighborhood scan.  Also prioritize the
detection of the sync channel closing, as done in other sync threads.

Change-Id: I57af0952e5bf8296fce5a8d5351b6c289f2a3ddb
diff --git a/services/syncbase/vsync/sync.go b/services/syncbase/vsync/sync.go
index 99a4a6e..60b6b58 100644
--- a/services/syncbase/vsync/sync.go
+++ b/services/syncbase/vsync/sync.go
@@ -229,7 +229,14 @@
 
 	for !s.Closed() {
 		select {
-		case update := <-ch:
+		case update, ok := <-ch:
+			if s.Closed() {
+				break
+			}
+			if !ok {
+				vlog.VI(1).Info("sync: discoverPeers: scan cancelled, stop listening and exit")
+				return
+			}
 			switch u := update.(type) {
 			case discovery.UpdateFound:
 				svc := &u.Value.Service