physical-lock: security: Add API for notification of changes to the default blessings.

BlessingStore.Default is a somewhat weird function - it says "default"
but practically it is meant for use by servers to reveal blessings to
clients when they don't have any other information about the client.

There seems to be a desire to allow servers to change the blessings they
identify themselves with dynamically (for example, syncbase servers
might want to identify themselves as delegates of all the applications
whose data they are hosting - which changes as new apps connect to it).

Two possible ways of achieving this:
(1) Servers continue to use BlessingStore.Default with an added API
to allow them to be notified of changes to this.
This is what is implemented in this commit
OR
(2) Drop BlessingStore.Default as an API completely and have an
explicit v.io/v23/rpc.Server.SetBlessings method that sets the
blessings used by the server.

I'm a bit torn as to which of these two alternatives is more
appropriate, but it seems that there is a leaning towards this one
since it keeps the BlessingStore as the one place to persist blessings.

One subtlety related to this approach - I haven't figured out
how to return a useful channel in the un-cached agent case
(see changes to v.io/x/ref/services/agent/agentlib/client.go).
But that may not be a practical concern?

Another TODO: Figure out the notification API in Java

MultiPart: 5/5

Change-Id: Ia48772f48908e693694bcf9ba09d40364329bc25
diff --git a/go/src/v.io/x/lock/lock/main.go b/go/src/v.io/x/lock/lock/main.go
index ed15954..c523429 100644
--- a/go/src/v.io/x/lock/lock/main.go
+++ b/go/src/v.io/x/lock/lock/main.go
@@ -451,8 +451,9 @@
 
 func lockUserNhName(ctx *context.T) string {
 	var (
-		principal = v23.GetPrincipal(ctx)
-		bNames    = security.BlessingNames(principal, principal.BlessingStore().Default())
+		principal    = v23.GetPrincipal(ctx)
+		blessings, _ = principal.BlessingStore().Default()
+		bNames       = security.BlessingNames(principal, blessings)
 	)
 	return lockUserNhPrefix + vUser(bNames...)
 }
diff --git a/go/src/v.io/x/lock/lockd/starter.go b/go/src/v.io/x/lock/lockd/starter.go
index bb85543..5985f77 100644
--- a/go/src/v.io/x/lock/lockd/starter.go
+++ b/go/src/v.io/x/lock/lockd/starter.go
@@ -75,7 +75,8 @@
 }
 
 func startLockServer(ctx *context.T, configDir string) (func(), error) {
-	lockNhSuffix := fmt.Sprintf("%v", v23.GetPrincipal(ctx).BlessingStore().Default())
+	blessings, _ := v23.GetPrincipal(ctx).BlessingStore().Default()
+	lockNhSuffix := fmt.Sprint(blessings)
 	// Start a local mounttable where the lock server would be
 	// mounted, and make this mounttable visible in the local
 	// neighborhood.
diff --git a/go/src/v.io/x/lock/lockd/unclaimed_lock.go b/go/src/v.io/x/lock/lockd/unclaimed_lock.go
index eb5f10d..4119895 100644
--- a/go/src/v.io/x/lock/lockd/unclaimed_lock.go
+++ b/go/src/v.io/x/lock/lockd/unclaimed_lock.go
@@ -44,9 +44,9 @@
 	}
 
 	var (
-		principal   = v23.GetPrincipal(ctx)
-		origDefault = principal.BlessingStore().Default()
-		restore     = func() error {
+		principal      = v23.GetPrincipal(ctx)
+		origDefault, _ = principal.BlessingStore().Default()
+		restore        = func() error {
 			// TODO(ataly): Remove roots of current default blessing if needed
 			// (i.e., if current default != origDefault).
 			if err := principal.BlessingStore().SetDefault(origDefault); err != nil {