fix for #1671 saving window settings

- we should not save settings from hidden windows.
- also should we respect cancellation

Closes #1671 SaveWindowPosition saves to position 0,0 if window not shown
This is unreliable and `Cancel` will only be true if we're the last subscriber of the `Closing` event. We should detach this in the `Closed` event.