If multiple threads fail at the same time (usually on the same assert), the
stack trace print can be all mixed up. This patch adds a lock to the stack trace
printing, so that they are printed on after the other.
Pull Request: https://projects.blender.org/blender/blender/pulls/139237