Fix crash on shutdown when having edited text forms
This fixes the same crash as bug 393334 but in a better way
the old way was setting a variable on destruction and then trying
to use that variable in a slot, but that's obviously wrong since
we were already mid destructing the object.