When closing the last visible tab, if there are any collapsed tab groups, make one of the tabs in a tab group active. Based on pre-existing behavior, activating a tab in a collapsed tab group causes the tab group to expand.
Currently, if you close the last visible tab while you still have collapsed tab groups present on the tab bar, the browser window will close. This is surprising and sad behavior for users.
Differential Revision: https://phabricator.services.mozilla.com/D228274