Start adapting pexpect to use ptyprocess

This mostly works.

- [ ] Fix a couple of failing asyncio tests