TF beam search: handle case without past
# What does this PR do?

Fixes `tests/vision_encoder_decoder/test_modeling_tf_vision_encoder_decoder.py::TFViT2GPT2ModelIntegrationTest::test_inference_coco_en`, whose root cause was in `beam_search` (it was not handling correctly cases without cache). This one slipped through the cracks, I probably forgot to run a final check on this test file before merging -- my bad 😅 
_The documentation is not available anymore as the PR was closed or merged._<|||||>(merging as Patrick has approved #16713, which also contains these changes)