Prevent `Trainer.evaluate()` crash when using only tensorboardX
# What does this PR do?

Fixes #12962

I did not write any tests because it seems like the logging integration callbacks have absolutely no testing at all, and I'm not creating a whole set of tests for a one-line fix.

## Who can review?

trainer: @sgugger

Thanks for the fix!