<!--  As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->

### 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 --> 4.0.4
* **Operating System:** 
  * <!-- (Platform and Version) e.g. macOS 10.13.6 / Windows 10 (1803) / Ubuntu 18.04 x64 --> Ubuntu 18.10 x64

### Expected Behavior
<!-- A clear and concise description of what you expected to happen. -->
 Observed in Zulip desktop app
 1. ```tray.destroy()``` api should destroy tray icon in panel
 2.  ```show app tray icon``` option in general setting, it should destroy and create tray icon on toggle

### Actual Behavior
<!-- A clear and concise description of what actually happened. -->
Previous tray icon are not destroy on toggle and new icon created i.e ```tray.destroy``` API is not working 

![Screenshot from 2019-03-30 18-57-58](https://user-images.githubusercontent.com/36422396/55276803-eacd7080-531d-11e9-842b-8d15bcfc09dd.png)


### To Reproduce
<!--
Your best chance of getting this bug looked at quickly is to provide a REPOSITORY that can be cloned and run.
-->

<!--
You can fork electron-quick-start (https://github.com/electron/electron-quick-start) and include a link to the branch with your changes.
-->

<!--
If you provide a URL, please list the commands required to clone/setup/run your repo e.g.--->
```
$ git clone https://github.com/zulip/zulip-electron
$ cd zulip-electron
$ npm install
$ npm start
```
you can find code in ``` zulip-electron/app/renderer/js/tray.js ```

```
function toggleTray() {
	let state;
	if (window.tray) {
		state = false;
		window.tray.destroy();
		if (window.tray.isDestroyed()) {
			window.tray = null;
		}
		ConfigUtil.setConfigItem('trayIcon', false);
	} else {
		state = true;
		createTray();
		if (process.platform === 'linux' || process.platform === 'win32') {
			renderNativeImage(unread).then(image => {
				window.tray.setImage(image);
				window.tray.setToolTip(unread + ' unread messages');
			});
		}
		ConfigUtil.setConfigItem('trayIcon', true);
	}
	const selector = 'webview:not([class*=disabled])';
	const webview = document.querySelector(selector);
	const webContents = webview.getWebContents();
	webContents.send('toggletray', state);
}
```

### Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->
![Image 2019-03-17 at 12 45 47 PM](https://user-images.githubusercontent.com/36422396/55276412-7395dd80-5319-11e9-9032-8da0050cd16c.jpeg)


atom/browser/api/atom_api_tray.cc
tray_icon_->SetToolTip(tool_tip);
}
void Tray::SetTitle(const std::string& title) {
#if defined(OS_MACOSX)
  tray_icon_->SetTitle(title);
#endif
}
std::string Tray::GetTitle() {
#if defined(OS_MACOSX)
  return tray_icon_->GetTitle();
#else
  return "";
#endif
}
void Tray::SetHighlightMode(TrayIcon::HighlightMode mode) {
  tray_icon_->SetHighlightMode(mode);
}
void Tray::SetIgnoreDoubleClickEvents(bool ignore) {
#if defined(OS_MACOSX)
  tray_icon_->SetIgnoreDoubleClickEvents(ignore);
#endif
}
bool Tray::GetIgnoreDoubleClickEvents() {
#if defined(OS_MACOSX)
  return tray_icon_->GetIgnoreDoubleClickEvents();
#else
  return false;
#endif
}
void Tray::DisplayBalloon(mate::Arguments* args,