Update to netty 4.0.0.CR1 and also flush only if needed