Pipeline only returns the result of the first sample in a batch
### System Info

transformers 4.24.0

### Who can help?

@Nars

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

I just used the code written on https://huggingface.co/docs/transformers/main_classes/pipelines, as follows:
```
from transformers import pipeline
from transformers.pipelines.pt_utils import KeyDataset
import datasets

dataset = datasets.load_dataset("imdb", name="plain_text", split="unsupervised")
pipe = pipeline("text-classification", device=0)
for out in pipe(KeyDataset(dataset, "text"), batch_size=8, truncation="only_first"):
    print(out)
    # [{'label': 'POSITIVE', 'score': 0.9998743534088135}]
    # Exactly the same output as before, but the content are passed
    # as batches to the model
```
The problem is the variable only contains one result of the first sample in a batch, even though the batch size is 8.
If I write:
```
[x for x in pipe(KeyDataset(dataset, "text"), batch_size=8, truncation="only_first")]
```
I will get the results of all samples.


### Expected behavior

The batch size is 8 so the variable "out" should contain 8 results (8 lists of dicts).