Fix crash when adding subkey
It's a use-after-free with the converted algorithm name, which only becomes apparent when using asan/ubsan