Add check for valid keys in `importprivkey`

The base58 armoring was checked, but not the resulting private key,
which could be out of range. Fix this by adding a check.
Merge pull request #3593

c7f9332 Add check for valid keys in `importprivkey` (Wladimir J. van der Laan)