Fix for #2542 for V3.9

Here is the fix for #2542 for Netty V3.9, identical to the one applied to Netty 4.0 to Master