…hem. RHEL 5, in particular, supports all the options we need, but doesn't define them in userspace's ptrace.h.
This makes tcsetattr return EINVAL on some systems, and there shouldn't be any flags in there we care about.
These are actually easier -- we just need to TIOCNOTTY, instead of playing games with a dummy child and setsid.
We were letting the child return from fork() and run to the next syscall. This happened to work on my system with 'less', but segfaulted on mutt. Instead, we need to reset the child to before the syscall point, so that none of its code is ever run.