* Electron version: 2.0.0-beta.1
* Operating system: macOS 10.13.3

### Expected behavior

Electron should not crash.

### Actual behavior

Electron crashes natively:

```
Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff44cebfcb __exceptionPreprocess + 171
1   libobjc.A.dylib                     0x00007fff6b98dc76 objc_exception_throw + 48
2   CoreFoundation                      0x00007fff44cf1d62 +[NSException raise:format:arguments:] + 98
3   Foundation                          0x00007fff46df0300 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4   AppKit                              0x00007fff42aa6708 -[NSWindowStackController insertWindow:atIndex:] + 246
5   AppKit                              0x00007fff42aabbda -[NSWindowStackController moveWindow:toWindowStackController:atIndex:] + 236
6   AppKit                              0x00007fff42635f48 -[NSWindow(NSWindowTabbing) _addTabbedWindow:ordered:] + 225
7   Electron Framework                  0x000000010b5990d8 _ZN4atom15NativeWindowMac15AddTabbedWindowEPNS_12NativeWindowE + 104
8   Electron Framework                  0x000000010b562984 _ZN4atom3api6Window15AddTabbedWindowEPNS_12NativeWindowE + 36
9   Electron Framework                  0x000000010b4e5bf1 _ZN4base8internal7InvokerINS0_9BindStateIMN4atom7BrowserEFvPN4mate9ArgumentsEEJNS0_17UnretainedWrapperIS4_EEEEEFvS7_EE3RunEPNS0_13BindStateBaseEOS7_ + 193
10  Electron Framework                  0x000000010b4e5bbf _ZN4base8internal7InvokerINS0_9BindStateIMN4atom7BrowserEFvPN4mate9ArgumentsEEJNS0_17UnretainedWrapperIS4_EEEEEFvS7_EE3RunEPNS0_13BindStateBaseEOS7_ + 143
11  Electron Framework                  0x000000010b4ec0ef _ZN4base8internal7InvokerINS0_9BindStateIMN4atom3api3AppEFbPN4mate9ArgumentsEEJEEEFbPS5_S8_EE3RunEPNS0_13BindStateBaseEOSC_OS8_ + 79
12  Electron Framework                  0x000000010b56b060 _ZN4base8internal7InvokerINS0_9BindStateIMN4atom3api6WindowEFvPNS3_12NativeWindowEEJEEEFvPS5_S7_EE3RunEPNS0_13BindStateBaseEOSB_OS7_ + 32
13  Electron Framework                  0x000000010b4ec044 _ZN4mate8internal10DispatcherIFbPN4atom3api3AppEPNS_9ArgumentsEEE18DispatchToCallbackERKN2v820FunctionCallbackInfoINSA_5ValueEEE + 500
14  Electron Framework                  0x000000010b4ecc6c _ZN4mate8internal10DispatcherIFvPN4atom3api3AppEPNS_9ArgumentsEEE18DispatchToCallbackERKN2v820FunctionCallbackInfoINSA_5ValueEEE + 396
15  Electron Framework                  0x000000010b56aecc _ZN4mate8internal10DispatcherIFvPN4atom3api6WindowEPNS2_12NativeWindowEEE18DispatchToCallbackERKN2v820FunctionCallbackInfoINSA_5ValueEEE + 124
16  libnode.dylib                       0x000000011015e071 _ZN2v88internal6StrDupEPKc + 609
17  libnode.dylib                       0x0000000110211ecc _ZNK2v88internal8compiler17BranchElimination21ControlPathConditionseqERKS3_ + 4028
18  libnode.dylib                       0x0000000110211503 _ZNK2v88internal8compiler17BranchElimination21ControlPathConditionseqERKS3_ + 1523
19  ???                                 0x00000446c2c0463d 0x0 + 4701961602621
20  ???                                 0x00000446c2cf45fc 0x0 + 4701962585596
21  ???                                 0x00000446c2cbf9ce 0x0 + 4701962369486
22  ???                                 0x00000446c2c05d1b 0x0 + 4701961608475
23  ???                                 0x00000446c2cf4048 0x0 + 4701962584136
24  ???                                 0x00000446c2cbf9ce 0x0 + 4701962369486
```

### How to reproduce

* run the electron quick start example
* after creating the main window, add:

`mainWindow.addTabbedWindow(mainWindow);`
atom/browser/native_window.cc
for (NativeWindowObserver &observer : observers_)
    observer.OnNewWindowForTab();
}
#if defined(OS_WIN)
void NativeWindow::NotifyWindowMessage(
    UINT message, WPARAM w_param, LPARAM l_param) {
  for (NativeWindowObserver& observer : observers_)
    observer.OnWindowMessage(message, w_param, l_param);
}
#endif
std::unique_ptr<SkRegion> NativeWindow::DraggableRegionsToSkRegion(
    const std::vector<DraggableRegion>& regions) {
  std::unique_ptr<SkRegion> sk_region(new SkRegion);
  for (const DraggableRegion& region : regions) {
    sk_region->op(
        region.bounds.x(),
        region.bounds.y(),
        region.bounds.right(),
        region.bounds.bottom(),
        region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
  }
  return sk_region;
}
}