* Electron version: 1.4.14
* Operating system: Windows

Hi!
I faced with issue described in this two comments: 
https://github.com/electron/electron/issues/6388#issuecomment-236498471
https://github.com/electron/electron/issues/6388#issuecomment-244483403
The main issue is fixed, but the session is lost if the app is closed immediately after login and setting the cookie.

### Expected behavior
Cookie should be saved.

### Actual behavior
When the app is closed after less then 10-15 seconds a cookie is set, it is not saved when the app is reopened. 

atom/browser/api/atom_api_cookies.h
#ifndef ATOM_BROWSER_API_ATOM_API_COOKIES_H_
#define ATOM_BROWSER_API_ATOM_API_COOKIES_H_
#include <string>
#include "atom/browser/api/trackable_object.h"
#include "atom/browser/net/atom_cookie_delegate.h"
#include "base/callback.h"
#include "native_mate/handle.h"
#include "net/cookies/canonical_cookie.h"
namespace base {
class DictionaryValue;
}
namespace net {
class URLRequestContextGetter;
}
namespace atom {
class AtomBrowserContext;
namespace api {
class Cookies : public mate::TrackableObject<Cookies>,
                public AtomCookieDelegate::Observer {
 public:
  enum Error {