[WebView] Better window.onbeforeunload handling

Let's first quickly check whether window.onbeforeunload is not null,
and then try to load empty page.
Always loading empty page was quite heavy, because it needed to clear
all web contents, it also fired loading signals, ...
[ClosedTabsManager] Use QLinkedList for storing closed tabs

The operations prepend() and takeFirst() are O(1) in linked list
[ClosedTabs] Fixed saving closed tabs after 1fd1691ee2