Use a higher timeout, and wait for all streams to be finished before closing pty.
also wait on all pumps.
Merge pull request #16 from dnephin/increase_timeout_for_pty

Increase timeout for pty