title: fs.writeFile with 'wx' flag does not fail if file exists
body: <p>I'm using <code>FileCookieStore</code> which requires a path to a cookiefile and that this file is already created. I want to use <code>fs.writeFile</code> to create this file if it does not already exist, but not to overwrite it if it <em>does</em> exist. However, in the implementation below, it overwrites the content of the cookiefile even if it exists, even though the <code>wx</code> -flag should throw an error and not overwrite the file if it already exists. </p>
  
  <pre><code>var cookiePath = "cookie.json"
  
  fs.writeFile(cookiePath, null, { flags: 'wx' }, function (err) {
      if (err) throw err;
  });
  
  var j = request.jar(new FileCookieStore(cookiePath));
  request = request.defaults({ jar : j });
  
  function login(callback) {
      // puts data into j which automatically writes the content to cookiePath
  }
  </code></pre>
  
  <p>Have I misunderstood the proper use of <code>writeFile</code> with the <code>wx</code>-flag? If I run <code>login()</code> the content of the cookie is automatically saved to cookie.json, but if I run the file again without calling <code>login</code>, <code>fs.writeFile</code> empties the cookiefile.</p>