copy_stream: handle and block on EAGAIN from the non-pipe IO