corrected the Deferred defn. for elasticssearch.js

The existing definition of  `Deferred` is causing `uncaught errors` with _.isUndefined (when used in async mode with other frameworks).

Other recline backends (like csv etc.) that did not have this problem are using this  `typeof jQuery !== undefined` definition.

Correcting the code to be compatible with other backends and also eliminate the uncaught error with async exec.