Merge change I0ad3fc43 into eclair

* changes:
  Avoid IAE by only dismissing dialog when still attached.