Fix #37305009 : Beam crash in secondary users

The background-policy check for a-priori app uids needs to be an appId
check rather than nominal uid.

Along the way, even though the code is not invoked after the boot
sequence currently, make the "is this uid on the a-priori list?"
check thread safe.

Bug 37305009
Test: manual

Change-Id: I7c2525f86e73b213057cd4b7f327191ec20c4a6d
1 file changed