[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()
[Ide] Fix crash in components view

Fixes bug 21292 - Regression: adding component throws InvalidCastException
from ICommandDelegatorRouter.GetDelegatedCommandTarget()