Fix dispose issues

Closing the gecko dialog sometimes crashed.