[#1895] Fix IllegalStateException which was produced during failing ChunkedWrite after the channel was closed