Fixing a regression when putting Safari in the foreground

The regression was introduced in 5f2462db6e57cf3a5ab0d3fc2c477acb1eb1d0db.
Using quotes prevents the command from being successful when using
Runtime.getRuntime.exec():
Not working: open -a "safari"
Working fine: open -a safari
Simplifying the algorithm to better react when opening Chrome DevTools.

ChromeDriver is implemented as a debugger for Chrome, and Chrome
currently only supports one debugger at a time (either DevTools or
ChromeDriver):
https://sites.google.com/a/chromium.org/chromedriver/help/devtools-window-keeps-closing

In practice, opening DevTools (when it is docked to the debugged window)
raises exceptions on the Java side.
This commit makes sure that those exceptions are ignored, so that,
instead of closing Chrome, the Selenium Java Robot is now paused until
DevTools are closed.

Note that if DevTools are opened in a separate window (instead of being
docked to the debugged window), the behavior is different: DevTools are
immediately closed because ChromeDriver reconnects and kicks out the
DevTools (there is apparently no way to detect and prevent this from
the Java side).
Accepting simple functions as callbacks

Instead of requiring a callback object with the fn, scope and args
properties, it is now accepted to pass a function directly (especially
when scope or args are not necessary).