Cleaning up the channels before registering a new thread.