Add a blocking variant of poll() and a helper, wait(), to invoke it.  Replace poll() with wait() where we need the exit status.  Without this, the exit code may not be available and file uploads/downloads will "fail" when they really succeeded (but the return value just didn't propagate yet)
Merge pull request #85 from zachriggle/blocking-poll-ssh

Add a blocking variant of poll() and a helper, wait(), to invoke it