Use kr's PTY for improved OS X behavior

This changes the PTY source over to the upstream by kr, as he's added
working Darwin support.
Merge pull request #261 from antifuchs/use-kr-pty

Use kr's PTY for improved OS X client behavior