[Extension] Added APIs for permission-function register.

The runtime permission mapping is registered by extension which
implements some specific API, for example: "bluetooth" ->
"bluetooth.read, bluetooth.write, bluetooth.management" Whenever there
comes a API permission request, we can tell whether this API is
registered, if yes, return the according permission name.
Updated permission storage unit test.