stdio: Set readable/writable flags properly

Set the readable/writable flags properly in net streams that have
a handle passed in (such as TTY streams).

Fix #4606