PackageManagerService: avoid NPE caused by BarcodeScanner

Change-Id: Ib4eda540f15586ec7818df6aef11d391aa075236