Fix exit from unicode mode

Retrieve set input method at beginning, and reset to that at end. Only do reset conditionally.
is it ever possible that we'll get to this point in the shutdown process, without `this.defaultIME` ever having been set? E.g., we get an error above with `defaultIME`, back out of the startup sequence, and head into this shutdown sequence. `this.args.unicodeKeyboard` is still true, but maybe `this.defaultIME` has never been set?

I.e., I'm wondering if we need to change the conditional to:

```js
if (this.args.unicodeKeyboard && this.defaultIME) {
```