Added support for unique_channel to automatically close a channel