CompositeByteBuf sets endOffset to capacity in some cases