Terminate shell when TerminalWidget is closed, fixing #282