[#1241] Fix NPE in AbstractTrafficShapingHandler and the logic
Also provide implementation for flush out of the box