CBG-1060 Add close waitgroup for sgReplicateManager (#4769)
CBG-1060 Add close waitgroup for sgReplicateManager (#4769)

sgReplicateManager.Stop() now blocks until clusterSubscribe and clusterUpdate goroutines have exited, avoiding potential races during test bucket teardown.
couchbaselabs/sync_gateway,couchbaselabs/sync_gateway,couchbaselabs/sync_gateway,couchbaselabs/sync_gateway