HD Wallets: add a threshold and pre-generate new keys, if keys are used (Version 2)

Version 2 of https://github.com/bitcoinj/bitcoinj/pull/42