* Electron version: 1.4.15 (probably older versions too).
* Operating system: macOS 10.12.2

When Quick Look is launched by right-clicking a file in a file dialog, clicking its close button doesn't work (and there's an audible beep), and after enough clicking around frequently it crashes. I suspect the same thing would happen using `dialog.showOpenDialog` presented as a sheet, but I haven't tested.

Minimal app to reproduce:
```js
const {app, BrowserWindow} = require('electron')

app.on('ready', () => {
  const win = new BrowserWindow({width: 300, height: 100})
  win.loadURL('data:text/html,<input type="file">')
})
```

Example:
![quicklook](https://cloud.githubusercontent.com/assets/5355/22160125/06120964-df12-11e6-86db-996f2233bf5e.gif)

Crash log: https://gist.github.com/javan/4c19dddd73b0581e60f6baf3b75d4dd8
atom/browser/web_dialog_helper.cc
flags |= file_dialog::FILE_DIALOG_OPEN_FILE;
        break;
      case content::FileChooserParams::UploadFolder:
        flags |= file_dialog::FILE_DIALOG_OPEN_DIRECTORY;
        break;
      default:
        NOTREACHED();
    }
    std::vector<base::FilePath> paths;
    AtomBrowserContext* browser_context = static_cast<AtomBrowserContext*>(
        window_->web_contents()->GetBrowserContext());
    settings.default_path = browser_context->prefs()->GetFilePath(
        prefs::kSelectFileLastDirectory).Append(params.default_file_name);
    settings.properties = flags;
    if (file_dialog::ShowOpenDialog(settings, &paths)) {
      for (auto& path : paths) {
        content::FileChooserFileInfo info;
        info.file_path = path;
        info.display_name = path.BaseName().value();
        result.push_back(info);
      }
      if (!paths.empty()) {
        browser_context->prefs()->SetFilePath(prefs::kSelectFileLastDirectory,
                                              paths[0].DirName());
      }
    }
  }
  render_frame_host->FilesSelectedInChooser(result, params.mode);
}
void WebDialogHelper::EnumerateDirectory(content::WebContents* web_contents,