Note that DLL_THREAD_ATTACH is also not a complete solution: it will not handle threads that were created before loading imm32.dll (so triggering lazy initialization in NtUserBuildHimcList may be interesting even if we take this patch).
Good point. I'll do something else then.