keystore: Wait for unlock operation to complete.

(cherry-pick from pie-cts-dev)

The performDeviceUnlock() waited for keyguard to go (from
the window manager's point of view), but it does not imply
the event is already propagated to keystore, especially after
 https://android.googlesource.com/platform/frameworks/base/+/\
   576c4d816c8efe8b9bf7dc88880d8ccde3beacee
changed the keystore to refer TrustManagerService instead of
the keyguard visibility.

Bug: 156057279
Test: CipherTest#testEmptyPlaintextEncryptsAndDecryptsWhenUnlockedRequired
Change-Id: I9b6d9a6c5754e1bdb6b0fb14b38722d837ac7256
Merged-In: I9b6d9a6c5754e1bdb6b0fb14b38722d837ac7256
(cherry picked from commit 0c8419386c6d84eae623a9e1c771357ab9927f23)
1 file changed