Only kill the whole process group if we have detached
Previously we always sent a signal to the whole of our current process
group when we got a signal such as SIGINT or SIGTERM. That's OK if
we have detached, because then we have our own process group, but not
if we haven't, because there might be other processes in our process
group that we don't know about. In the latter case we now just send
the signal individually to the child processes that we have forked off
to run things like the connect script, charshunt or pty command.