Fix for traffic shaping.

Includes netty PR 2696. This should be reverted once other traffic shaping fixes (PR 2722)
are merged into the netty 4.0 branch.