[#1976] Fix IndexOutOfBoundsException when calling CompositeByteBuf.discardReadComponents()