[#1624] Fix resource leak when writing to a closed / not-open channel