https://bugs.winehq.org/show_bug.cgi?id=42470
--- Comment #6 from Dmitry Timoshkov dmitry@baikal.ru --- Created attachment 57444 --> https://bugs.winehq.org/attachment.cgi?id=57444 hack
Something like the attached hack may help.
A little bit of a background: from the attached backtrace it looks like the deadlock happens during process exit when one of the threads that held the process heap lock has been killed, and the msvcrt's PROCESS_DETACH handler calls RtlDeleteCriticalSection() which hangs when it calls RtlFreeHeap() for the critical section's DebugInfo.