Scriptable performance and other issues

Don't access MainWindow::browser() directly from script's thread.

Lock ClipboardBrowser from script's thread and more safely in general.