ISPN-4056 Enable caching of permission masks to cluster registry

https://issues.jboss.org/browse/ISPN-4056

also fixes a couple of bugs that were affecting the test.