Avoid instantiation exception on orientation change when dialog is open.