(ScriptingEditor) Code the tab closing more defensively
(ScriptingEditor) Fix the opening of templates consecutive to recent change in tab opening
(ScriptingEditor) make 'close all' menu action more defensive
(ScriptingEditor) Make the 'close others' menu action more defensive

... by removing the while loop that may could have run indefinitely in case
of a bug in closeTab...