Check for key existence in hash_word

Add simple existence check of the return value of utf8_casefold||strdup.

Memory faults could occur when passing NULL to g_hash_table_insert by
trying to hash NULL.