Save session when last window is closed (not finished yet)