Bug 850349 - Cleanup browser search tests while debugging intermittent failure in browser_contextmenu.js. r=gavin

* browser_426329.js - Fix exception in popupshowing event listener causing search history dropdown to remain open on subsequent tests.
* browser_contextmenu.js - Add some debug messages.
                         - Move |doOnloadOnce(checkSearchURL);| just before the search tab opens so there is less interference with later tests.
                         - Add nsISelectionListener to know when selection has finished.
* head.js - Consolidate duplicated doOnloadOnce function.
* test.html - Fix character set warning.
Merge m-c to inbound
Bug 850928 - Fix assorted JS compiler warnings. r=dholbert,dvander

--HG--
extra : rebase_source : 1d60ed741b32b3ecd3028cca11e93d601b77b01f