This is a bug in emacs if the current behavior has some reasonable
use or is part of some standard. This is a bug in the kernel if
there's no reason for the current behavior.
The bug goes far beyond what Alexey was reporting. The bug is the fact
that emacs leaves the pty owned by root, mode 666, instead of doing
something (for example, a setuid helper) to allocate the pty and assure
that it has the correct ownership and permissions.
- Ted