Unset welcome flag, if the controller doesn't have welcome template
Fixes #31111 - set welcome flag only if welcome exists
Set @welcome, only if the 'welcome' template exists for given resource.
It messes up some other parts of layout, if the flag is wrongly set.
To support this, it also improves the rescue and moves it to `safe_constantize` failsafe in `model_of_controller` method.