eliminate unnecessary CBC-mode AES decryptions

provides a 30% speed increase to mSIGNA wallets, and tiny increases
to Bitcoin Core and bitcoinj wallets; also a small unit test bug fix