Only close the tty during exit process and leave freeing it to when the socket is lost.

2 files changed