Ensure packages in shared user are valid

Package information is tracked by several different structures
and updated in different synchronized blocks. As such, the set
of packages that are part of a shared user are updated after
the set of installed packages is updated. And, in some cases,
a removed package will still be listed as a member of a shared
user id.

Before passing a package to the PermissionManager to check
for permission grants, ensure the package actually exists and
is known to the system.

Bug: 111075456
Test: Manual. Builds and runs.
Change-Id: Ibb4f44f50141d43bf2367747d6d5813648d42fd4
1 file changed