Changes to make easier to use PouchDB on Node on Windows

Implements needed changes for https://github.com/pouchdb/pouchdb/issues/3110
wrap this in a (function () {}()) to avoid v8 deopt