http://bugs.winehq.org/show_bug.cgi?id=33331
--- Comment #3 from Rico kgbricola@web.de 2013-04-04 04:01:54 CDT --- A somewhat similar problem is bug 32951 .
Thus it seems, that all threads beside the main tread should be terminated first, regardless where the thread originates from. Then all resources could be unloaded.