Fix exit from unicode mode

Retrieve set input method at beginning, and reset to that at end. Only do reset conditionally.
I still think we don't need to restore the IME on shutdown. I mean when we install a app we don't uninstall it on shutdown, when we unlock a device we don't lock it at the end, that should be the same for IME.