Fixes crash when addTab returns -1 during session restore.