Building the depsgraph from non-main thread is unsafe currently, as it
may trigger some deferred processing on the Main data itself (here, the
update/resync of viewlayer collections).
So this commit moves the building of the export depsgraph back into the
main thread for the USD exporter, while keeping the depsgraph evaluation
code (which is typically the heavy part with complex scenes) into the
threaded job worker code.
Issue was randomly (but fairly commonly) reproducible when trying to export
most of the Pets project production files (on linux debug build with ASAN).
Root issue has been reported and is being discussed in #112534, ideally a
better solution can be designed at depsgraph level in the future.
NOTE: Should likely also be back-ported to 3.6 and 3.3 LTS.
Pull Request: https://projects.blender.org/blender/blender/pulls/113537