Restore terminal mode on exit
Merge pull request #5 from drkitty/raw-mode-fix

Looks good to me.