When linking e.g. a mesh, a local object using that linked obdata was
still presented with the options to change modes. It was only later when
actually trying to change to a mode that the user was presented with
e.g. following error:
"Unable to execute 'Toggle Edit Mode', error changing modes"
Now catch this early so that the mode_set dropdown or pie menus are
already greyed out.
Issue came up in T87435.