Fix fingerprint listening delay when locking phone

Currently, when the user presses the power button to lock their phone,
there's a delay before the device starts listening for fingerprint to
unclock the phone again. This commit resets the keyguard going away
state earlier when the phone is going to sleep in order to remove this
delay. It also adds a new unit test to exercise this behavior.

Test: atest KeyguardViewMediatorTest
Test: Lock screen, quickly tap fingerprint, verify there is no delay

Fixes: 141445468
Change-Id: Ib2f7d956122eec39e5164e865001a08fa70f47cc
2 files changed