Fix IllegalStateException caused by ChannelHandlerAppender