Fix exit from unicode mode

Retrieve set input method at beginning, and reset to that at end. Only do reset conditionally.
Hmm, does not restoring the IME mean the device works different for other apps as well? I do think it's nice to restore the IME if it would put the device in a confusing state. Leaving an app installed doesn't really do that.