Fix crash at exit when not using systray.

Dangling pointer was deleted.