session: cleanup and restore terminal settings
Merge branch 'devel' of github.com:01org/tlm into devel