Avoid memory corruption when registering boxed synonyms repeatedly

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