[Trainer] Fix nan-loss condition
Fixes a change in the nan loss handling logic introduced by #13896

With `is_torch_tpu_available()==False` and `(torch.isnan(tr_loss_step) or torch.isinf(tr_loss_step))==False` 
the `else:` condition was never reached, so the training loss was always `0.0`.