Clean up transaction metadata after deleting an account or wallet
This fix is actually two folds:
It discards incoherent transactions fetched from the DB, if any, and shout a warning in the log. This is in order to make the system more resilient to conconcurrent calls while a wallet or account is being deleted (since metadata and accounts / wallets are stored in separated databases, we can’t easily run both delete in a single transaction).
It also deletes corresponding metadata when an account or a wallet is removed. This may cause extra damage? What if there are pending transactions when we delete the account or wallet.