fix will-navigate events when navigating to a different URL

I'm not entirely sure about this, but looking through the frontend it looks like the timing of the `will-navigate` and `navigate` events are mainly for tests. Right now `will-navigate` is not fired when changing the URL of the page. This may fix other obscure bugs that we are seeing. However, the timing is wrong; `will-navigate` now fires after the navigation actually happens... but at least it fires.

The problem is that in `onFrameStartedLoading` we have no way to detect if it's a top-level page or not, and we only want to send these events for top-level pages.