Don't select tabs when being destroyed

When tabs are being destroyed don't trigger `select` or `deselect` the other tabs.

Added a test for @tfranceuk's fix (#2596).