procfs, and more pty cleanup