Fix NPE when fragment detached from activity
Avoid NullPointerException
Avoid IllegalStateException

Reported for Kaiten:
java.lang.IllegalStateException: Can not perform this action after
onSaveInstanceState
...
at android.support.v4.app.DialogFragment.dismiss