* **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
api::WebContents* api_web_contents)
    : api_web_contents_(api_web_contents) {}
AtomJavaScriptDialogManager::~AtomJavaScriptDialogManager() = default;
void AtomJavaScriptDialogManager::RunJavaScriptDialog(
    content::WebContents* web_contents,
    content::RenderFrameHost* rfh,
    JavaScriptDialogType dialog_type,
    const base::string16& message_text,
    const base::string16& default_prompt_text,
    DialogClosedCallback callback,
    bool* did_suppress_message) {
  auto origin_url = rfh->GetLastCommittedURL();
  const std::string& origin = origin_url.GetOrigin().spec();
  if (origin_counts_[origin] == kUserWantsNoMoreDialogs) {
    return std::move(callback).Run(false, base::string16());
  }
  if (dialog_type != JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_ALERT &&
      dialog_type != JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_CONFIRM) {
    std::move(callback).Run(false, base::string16());