SurfaceFlinger: Avoid calling to SystemServer with lock held.

PermissionCache::checkPermission may make a blocking call in to system-server. We don't
have any lock ordering issues as we end up acquiring the PackageManager lock, and PM
does not call back to SF. However, we can have Binder thread exhaustion issues, in that
many threads can be calling in to the ActivityManager, which could be blocked on the WM,
which could be blocked on SF. If the number of threads calling in to AM is > than our
binder thread pool size we deadlock. I'm not sure we are totally resistant against
thread exhaustion issues but this one is easy enough to fix and there are reports of it.

Bug: 124281288
Test: Existing tests pass
Change-Id: I4ffab2df921478df020bb1089dcd13dd79d99ce6
3 files changed