Merge "Prevent task from exiting immersive twice on close" into main