Observe the app shutdown event.