Fix AttributeError when closing card creation dialog with Kanji field selected

Although the error disappeared, please, @cayennes, check if the fix is correct as I'm not a Python programmer.

Thanks