https://bugs.winehq.org/show_bug.cgi?id=39708
--- Comment #2 from Nikita nikita.hldm@gmail.com --- (In reply to Sebastian Lackner from comment #1)
Just a wild guess, but the issue sounds similar to https://github.com/wine-compholio/wine-staging/tree/master/patches/msvcrt- StdHandle_RefCount. Could you try if this patchset also helps?
These patches do not help.