Fixed memory leaks with alert dialogs not being dismissed on rotation changes