Fix extraScripts legacy mode issue

If run from command line with just one extraScript, it was passed as a
string instead of a one-element array and hence not included in the page.
Fixing an issue with browser disconnection and task timeouts.

This commit fixes the following bug: when a browser is disconnected
during a test, the task timeout function is not canceled. When it is
executed, it assigns a new task to the disconnected browser, which
will lead to a timeout (as there is no browser connected to execute
the task), and then another task will be assigned and so on...