Fixes https://gitlab.com/kicad/code/kicad/issues/13630
Keeping a function reference is only in scope when the call is immediately executed, not when it enters its own event loop. This commit also excises one more onUpdateUI call as it is not needed Fixes https://gitlab.com/kicad/code/kicad/issues/12395
Fixes https://gitlab.com/kicad/code/kicad/issues/5975