added last-dicth attempt to catch SIGCHLD when slave pty is at EOF