Bug 910697 - Shows previous keyboard before displaying correct one

Fix for [#910697](https://bugzilla.mozilla.org/show_bug.cgi?id=910697). Basically:

1. Fix showIME and hideIME as they don't do anything at the moment. Uses visibility rather than display to ensure that we don't need another full reflow of all keys.
2. Don't call showIME before creating the new keyboard is complete
3. Don't call hideIME if a focus event comes directly after blur
4. Test cases around all this