Adjust the order of TTY restoration on Windows.
Adjust the order of TTY restoration on Windows.

Normal commands no longer produce unsupported escape sequences. This
addresses #798.

elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish