Fixed shutdown errors in browser app.

These were caused by the new shorter non-garbage-collected lifetime of ScriptNodes. The browser should have been keeping a hold of the window as a member variable all along anyway, because in hosts such as Maya, EventLoop.mainEventLoop().start() returns immediately, so the app must maintain a reference to the window in order to keep the window open for as long as the app is alive.