HD Wallets: fix key lookahead and auto-advance so it works as intended.

Previously the codepath that was supposed to mark keys as used didn't work, and the lookahead calculation wasn't quite right. Now the current key advances correctly when an inbound tx is found that spends to it, including pending transactions. Additionally the lookahead zone now has the threshold zone after it, not inside it, meaning that if you request a lookahead size of 100 keys you'll actually always have at least 100 keys, never less.
Fix reason why BIP38 test vector is failing, Java strings can contain null characters just fine.
Fix some exception messages in BIP38PrivateKey.