Null check before invoking callback

Also made sure to invoke the callback on the main
handler thread, like all other callbacks.

Fixes: 182164620
Test: atest PackageManagerTests
Change-Id: Ic2abe0877a716e83a10965bf348888a53ae95db8
2 files changed