Use select rather than multiple threads to read from subprocess.  This works on OS-X, and is also a lot simpler.