When a thread executtes NtTerminateProcess(self), all the other threads get killed by wineserver. Then, if self-terminating thread tries to tear down mmdevapi streams during loader shutdown sequence, wait operations on stream hang forever waiting for the condition which can only be set from PA main loop thread.
Fixes hang on exit in Warrior Maiden Lecia and the Lost Fortress.