Save state on Window destroy, finalize may not run