MDL-43664 Javascript: Use YUI indexOf for pending_js tracking

Some old browsers do not support indexOf and so cannot determine whether JS
script is in progress. The YUI Y.Array module polyfills the indexOf
functionality when it does not exist.