Close the underlying channel on unclean close
Minor cleanup