fix bug, add channel write failure listener, and add unack msg re-send count