Set cookie request header for same origin window.document.cookie

This is experimental.
getDoc() is there only to respect current 'global' isolation.
It might only work if 'window' is available in the scope where require('w3c-xmlhttprequest') is called,
like https://github.com/kapouer/jsdom/blob/master/lib/jsdom/browser/index.js#L230.