Check for keyid conflicts between new keys
When the keymgr needs to create new keys, it is possible it needs to create multiple keys. The keymgr checks for keyid conflicts with already existing keys, but it should also check against that it just created.
(cherry picked from commit 668301f1)
Closes #2628 (closed)