More idiomatic way to check closed channel.