Correctly set window title for restored and just opened tabs