outputconfigurationinterface: don't crash if mode is invalid

When the client issues the request, the compositor may have already destroyed
the mode object.
BUG: 453042
FIXED-IN: 5.24.5
2 jobs for Plasma/5.24 in 5 minutes and 27 seconds (queued for 3 seconds)