Fix frame switching after frame redirect/creation (follow on)

Continuation of #1177.

@mrmr1993:  I did some tidy up of #1177.  Could you double check, please, and also check the comment (which I will make in a few moments) below?
@smblott-github if we don't do this, `frameIdsForTab[tabId]` falls out of sync with the frame that's actually focused until the next switch (meaning that eg. `gf` can focus the currently focused frame if there are 2 frames, which is jarring).

Really, we should replace the frame in the array with the one that's created in its place (if there is one -- ie. if there was a redirect) but I can't think of a tidy way to do this. I may look into it later.