Don't start a dialog if the activity is finishing. Fixes a race condition causing a crash.