Runtime check for console window to block non-console hosts.

This moves the console window check to IModuleAssemblyInitializer.OnImport so that the error message can be loaded from resources.