Bug 907629 - Notify STK application when Settings is about to get killed

It seems like doing it in the onunload callback is already too late, and
it makes the STK behaving wrongly.