Fix memory leak in keystore

When operations are aborted by an app or an app dies, tokens are not
removed from the device token map. This patch moves the this map from
key_store_service to KeyStore so that it can be accessed by the
keymaster workers. It also adds calls to removeOperationDevice to the
binderDied hook of the keymaster workers as well as to keystore service
abort.

Add a call to removeOperationDevice() inside pruneOperation() function on
keystore/keymaster_worker.cpp

Bug: 139383076
Test: atest keystore_unit_tests (passed)

Change-Id: I90d4dc9d4510f4ac250022c89240a742b9e8d4b4
4 files changed