The problem occurs with applications while one thread is reading from the stdin and another thread which tries to load a DLL and tries to get hold of that handle (inherited).
This stack you typically see if you analyze your hang using debugging tools.
kernel32!GetFileType
comctl32!_ioinit
comctl32!_CRT_INIT
comctl32!_DllMainCRTStartup
ntdll!LdrpCallInitRoutine
ntdll!LdrpRunInitializeRoutines
ntdll!LdrpLoadDll
ntdll!LdrLoadDll