unify keypair name handling

CreateKeyPair and ImportKeypair handled name checks in a different
way. When importing a keypair, one got a generic error message
without a hint, that the name was wrong.

This is the backport to Havana.

Managed to drop the original changei, which was
Ie82c0cd21f70aae3f55b84a1c05c9f170eaec312

Closes-Bug: #1265563
(cherry picked from commit eafe0b260d24f65d6f0b0487a74c352a01a53d84)

Change-Id: I10d5a7151242afeeed59965b361c89cc97b53b46
Merge "unify keypair name handling" into stable/havana