lua-factory: Fix use-after-free

When the key type isn't handled, we try to print the key name. Better
for it not to be freed when we do that.

https://bugzilla.gnome.org/show_bug.cgi?id=740765