Don't look up storage for uninstalled apps.

This also catches any potential state exceptions which may
occur when errors occur during storage queries on a package.
This should stop the crashes.

Change-Id: Idab92434f74eaf44ba7b3fdbbc6c2c1ac9b10ee2
Fixes: 36075582
Test: FrameworkServicesTest & manually verified file is populated
(cherry picked from commit 579e5581d5339dbdc79b9176fcc2fad660d155db)
2 files changed