* **Electron Version:**
  * v4.0.1
* **Operating System:**
  * macOS 10.13.6

### Expected Behavior
When you press the escape key on a confirm dialog, it should be the same as pressing cancel.

### Actual Behavior
When you press escape, it presses "OK". This has the potential to be pretty dangerous, as it may continue with a destructive action the user had not intended.

### To Reproduce

Open a window.confirm, then press escape.

### Additional Information

This seems to be due to [this line](https://github.com/electron/electron/blob/master/atom/browser/atom_javascript_dialog_manager.cc#L79), where `cancelId`([5th argument](https://github.com/electron/electron/blob/master/atom/browser/ui/message_box_mac.mm#L97)) is hardcoded to `0`.

For a confirm dialog, we [`push_back`](https://github.com/electron/electron/blob/master/atom/browser/atom_javascript_dialog_manager.cc#L57) the `Cancel` button, so this should be `1`.

atom/browser/atom_javascript_dialog_manager.cc
return;
  }
  std::vector<std::string> buttons = {"OK"};
  if (dialog_type == JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_CONFIRM) {
    buttons.push_back("Cancel");
  }
  origin_counts_[origin]++;
  auto* web_preferences = WebContentsPreferences::From(web_contents);
  std::string checkbox;
  if (origin_counts_[origin] > 1 && web_preferences &&
      web_preferences->IsEnabled("safeDialogs") &&
      !web_preferences->GetPreference("safeDialogsMessage", &checkbox)) {
    checkbox = "Prevent this app from creating additional dialogs";
  }
  
  NativeWindow* window = nullptr;
  if (web_preferences && !web_preferences->IsEnabled(options::kOffscreen)) {
    auto* relay = NativeWindowRelay::FromWebContents(web_contents);
    if (relay)
      window = relay->GetNativeWindow();
  }
  atom::ShowMessageBox(
      window, atom::MessageBoxType::MESSAGE_BOX_TYPE_NONE, buttons, -1, 0,
      atom::MessageBoxOptions::MESSAGE_BOX_NONE, "",
      base::UTF16ToUTF8(message_text), "", checkbox, false, gfx::ImageSkia(),
      base::Bind(&AtomJavaScriptDialogManager::OnMessageBoxCallback,
                 base::Unretained(this), base::Passed(std::move(callback)),
                 origin));
}
void AtomJavaScriptDialogManager::RunBeforeUnloadDialog(