Fix wallet_account_update_active_key.log test
Refactor update_registered_account and update_active_key

Previously there was a large section of near-duplicate code between
these two functions. That code is now extracted into a function, and
significantly simplified.