Generate: correctly detect default max length
# What does this PR do?

Fixes #20894.

Now that we are using the generation config, we can detect the use of a default `max_length` and a potential clash with `max_new_tokens` with values other than `max_length=20` :)

After this change, the example in the issue linked above works correctly.
_The documentation is not available anymore as the PR was closed or merged._