Fix NPE in isForegroundAllowedLocked()

Sometimes crash happens if a preferred foreground service is deleted.
In order to avoid this, null check should be added.

Test: manual
Bug: 33062858
Change-Id: I349697cae8b38976d22e20fbddc64612a9df57c4
1 file changed