Fix finding the default keyboard for Mint 17/Cinnamon

This fixes https://jira.sil.org/browse/WS-285 "Crash while trying
to switch keyboards in Wasta".  Also did a bit of code cleanup in
related keyboarding code.
Merge pull request #152 from sillsdev/Fix-WS-285

Fix finding the default keyboard for Mint 17/Cinnamon