Fix a bug where a closed channel was tried to register with the eventloop