Fix bug in how wallet_db stores account records and update tests

Previously, the account record was stored only by account address, but
not by active addresses. This caused problems when the active address
did not match the account address. This is now fixed.

Also, add tests to verify that sending a transaction to an account with
an updated active key is working properly.