XBPython: fix crash on exit because of executing onNotification callback on already destroyed scripts