Fix for issue 539, adds atomic operation for changing wallet encryption key and password.

This is a fix for https://code.google.com/p/bitcoinj/issues/detail?id=539

Please verify if I'm using correct lock. Two options are: `lock` or `keychainLock`