Fix select loop reading from SSH channel

When select() returns a list of file descriptors with data waiting, they
*all* need to be flushed. The current logic will *not* empty stderr if
EOF is encountered on stdout, due to the 'break' statement.

I've rewritten the loop the way I think it should be.

Signed-off-by: martin f. krafft <madduck@madduck.net>