Handle window.open and <a target="..."> correctly

In previous implementation clicking on external links would leak WebContents and make renderer process linger when it is requested to close.

This fixes a bug that might have caused #719.