keyboard: Add back the gtk+ IM module handling

This shouldn't have been removed in commit
326ee9f9a102a58941473e08fbe6221e70369f7f.

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