### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

* [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
* [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
* [X] I have searched the issue tracker for an issue that matches the one I want to file, without success.

### Issue Details

* **Electron Version:**
  * <!-- (output of `node_modules/.bin/electron --version`) e.g. 4.0.3 -->v5.0.0-beta.7
* **Operating System:**
  * <!-- (Platform and Version) e.g. macOS 10.13.6 / Windows 10 (1803) / Ubuntu 18.04 x64 --> Windows 10

### Expected Behavior
<!-- A clear and concise description of what you expected to happen. -->
Electron app should not crash when toggling `Alt` key when `setMenuBarVisibility(false)`

### Actual Behavior
<!-- A clear and concise description of what actually happened. -->
Electron app crashes when `Alt` key is pressed

### To Reproduce
```sh
$ git clone  https://github.com/KiranNiranjan/electron-quick-start.git -b crash
$ npm install
$ npm start || electron .
```
When the app finishes loading press the `Alt` and the app crashes

### Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->
![2019-04-02 12 51 11](https://user-images.githubusercontent.com/13243259/55383546-1af75800-5546-11e9-873e-22be38ea6247.gif)


### Additional Information
<!-- Add any other context about the problem here. -->
Looks similary to the following issue -> https://github.com/electron/electron/pull/17474

atom/browser/ui/views/root_view.cc
#include "atom/browser/ui/views/root_view.h"
#include "atom/browser/native_window.h"
#include "atom/browser/ui/views/menu_bar.h"
#include "content/public/browser/native_web_keyboard_event.h"
namespace atom {
namespace {
#if defined(OS_WIN)
const int kMenuBarHeight = 20;
#else
const int kMenuBarHeight = 25;
#endif
bool IsAltKey(const content::NativeWebKeyboardEvent& event) {
  return event.windows_key_code == ui::VKEY_MENU;
}
bool IsAltModifier(const content::NativeWebKeyboardEvent& event) {
  typedef content::NativeWebKeyboardEvent::Modifiers Modifiers;
  int modifiers = event.GetModifiers();
  modifiers &= ~Modifiers::kNumLockOn;
  modifiers &= ~Modifiers::kCapsLockOn;
  return (modifiers == Modifiers::kAltKey) ||
         (modifiers == (Modifiers::kAltKey | Modifiers::kIsLeft)) ||
         (modifiers == (Modifiers::kAltKey | Modifiers::kIsRight));
}
}  
RootView::RootView(NativeWindow* window)