Fix runtime error on deleted cpp obj

(this can happens because the timer call us back just after the
widget has been deleted, while other modes are being uninstalled)