when opening a new tab from a link or window.open, allow back to close it

This implements something I've wanted in a mobile browser for a
while.  When a page has an <a target="_blank"> or window.open(),
remember the reference between the opener and new tab.  When
deciding whether the new tab can go back in history, if it has an
opener reference, always allow going back.  When we reach the
beginning of the history, automatically close the tab and focus the
tab that opened us.

This makes it easier to browse sites like i.reddit.com that open new
tabs for every link (when configured) rather than having to bring up
the tab view, close the current one, then scroll back or pick the
old one.