Fix two crashes that happen when closing a tab.

I should do more testing with Web+. HaikuLauncher doesn't have tabs
which means the sequence of deleting things is a bit different (the
window is always closed before deleting the page and view).