This patch fixes #509 by using async read instead of polling a non-blocking fd. This reduces CPU usage when the ptys are idle.