Fixed window leaks from dialogs not being dismissed when orientation changes