Fix purpose enums
We happened to still use GTK+ input purpose enums values. Luckily the enums are binary compatible so this shouldn't result in bugs, but is wrong :).
Just noticed the MR also slipped a commit I had around freeing a couple of strings. Unrelated, but doesn't hurt to have.