close output channel when input channel is closed