Merge "Improve handling of popup window exit when host window goes away"