Fix emission of document-activate signal and associated UI glitches
PR https://github.com/geany/geany/pull/3267 broke handling of several
special tab switch cases:
* By showing the tab's child too early, it prevented the switch-page
handler to properly work in situations where there was only one page,
as the tab switch would happen at page creation yet the document
would not be valid yet.
* It removed explicit emission of the switch-page signal when the
source and target pages are the same after session opening, which
happens if the active session page is the first one.
Fix this by mostly reverting
23367de0c5237558ea63cb8c711d46390d978267
and implementing the delay directly in the switch-page handler.
Fixes #3684.