Fix multiple crashes of xwalk_browsertest in Debug mode

Runtime is responsible for creating and destroying the ui::Compositor through
NativeAppWindow. So, we should call window Close() before discarding the
Runtime and we should wait for the window is actually closed so that the
compositor is deleted normally (Credits to @nagineni for the preliminary
analysis).

Another problem which is fixed by this patch is the early return from the
"XWalkBrowserMainParts::PreMainMessageLoopRun" method if application system
managed to handle command line arguments as this did not take into account
the "parameters_.ui_task". This problem led to hanging of some browser tests
that were using command line arguments e.g. "ApplicationOnInstalledEventTest".

https://crosswalk-project.org/jira/browse/XWALK-1014