Fix possible crash/"deadlock" when there are no tabs.