Implement IO.copy_stream for non-file input. Fixes #1103.

This implementation is still pretty naive, just expecting -1 to
indicate that the incoming channel has reached a terminating
point. With the amount of wrapping the JDK does around the
actual file descriptors, it may be the best we can do without
building more of our IO layer using native calls.