Some Wine tests are multi-threaded or start child processes which can result in traces and failure messages being garbled which prevents them from being recognized by continuous integration tools. So printing the tests messages is now serialized. Note that if a process crashes while holding the mutex, that mutex will be abandonned and not cause a deadlock.
-- v4: tests: Make sure only one thread prints traces at a time.