[Extension] Enabled permission cache in extension process.

Speed up performance by caching the persistent and session permissions
in the extension process.
[Extension] Enabled registering permissions in XW_Initialize.

There was a dependency loop in registering the permissions during
extension initialization. The permission delegate used by registering
permissions was initialized after constructor, so that we cannot
use the delegate to register permissions in there.
The patch moved the delegate initialization into constructor and
removed the 'set_permissions_delegate' function.
Merge pull request #1608 from mbbill/register_fix

[Extension] Enabled registering permissions in XW_Initialize.
Merge pull request #1614 from mbbill/cache

[Extension] Enabled permission cache in extension process.