Explicitly ensure that wallet is unlocked in importprivkey
This makes for a more useful error reply (fixes #957).