Keyguard: LN: fix and harden against null pointer exceptions

Change-Id: Iff66791bb35b911e837b0a1747a72effdce507e3
SlimRecents: fix sometimes missing first task

apply the fix for aosp recents

https://github.com/SlimRoms/frameworks_base/commit/760413134a5efe60c1d4473322e467152d71c80b

as well to slimrecents

Change-Id: Ibce0707cf516034675451d0440608bafe097c92d