Fix hp search for non sigopt backends
# What does this PR do?

This PR fixes the bug introduced in #13572 for the hyperparameter search using Ray Tune or Optuna. More speficially the bug introduced is on [this line](https://github.com/huggingface/transformers/blob/36fc401621297d2f917a0b4df4a0718067966c12/src/transformers/trainer.py#L1241)
```py
self.state.trial_params = hp_params(trial.assignments) if trial is not None else None
```

which used to be
```py
self.state.trial_params = hp_params(trial) if trial is not None else None
```

For the HP backends different from SigOpt, the `trial` object has no `assignmnents`, hence the failure.

Fixes #13875 