Warn user when they tries to close a window when there are unsaved changes.
Optionally, save unsaved changes locally so they can be retrieved later.