[Ide] Fix document focusing issue

When focusing a document with SelectWindow() make sure the document content
is created before exiting the method, since some add-ins depend on that.

Fixes bug #21291 - Regression: "Get More Components" throws
TargetInvocationException due to NullReferenceException in GetNativeWindow()