Allow non-global define in AMD detection

[RequireJS](http://requirejs.org/)' r.js builder can be used with [almond](https://github.com/jrburke/almond) to wrap all modules in
an IIFE, with define in the closure rather than on the global object.
This adds support for this case.