Fix problem with progress dialog so close will run on swing thread.