Prevent stack overflow in ChunkStreamFactory.findEnd