Replace cast operator with getValue() for key store return codes

The value of the error code is not intended to be used
in checks, and instead isOk() should be used. A few places
were found which used the error codes directly via the
cast operator. To make it less likely this will happen
in the future unintentionally, the cast operator is being
removed. Some code still wants to access the error code
directly, such as when logging, so getValue() is added
for these cases.

Bug: 119771891
Test: Built for walleye successfully, basic operations with
      keystore_cli_v2 tool work correctly.
Change-Id: I46e82d66dc4932472d8a5b2749ece08e398e7c88
8 files changed