Update global.js to correctly identify globals

This commit fixes a problem with Firefox extensions. when we did `var Error = global.Error;` Error bacame undefined because `window` is not the global context in that scenario.

Steps to reproduce the issue solved:

 - Create a new Firefox extension
 - import Bluebird
 - An error occurs in `inherits`, that error stems from Parent being undefined, which in that case is Error.

How this solves the issue:

In firefox extensions you can still access the global scope through window with `window.wrappedJSObject`. When we detect global - we now check for this.
Merge pull request #40 from benjamingr/patch-1

Update global.js to correctly identify globals