CURA-6225 Do thread check in the wrapper function, not outside.
This reverts commit 21099e30cb666d65b53fbcd749793ce6f5fe6776. It was causing a segfault when saving UFP files.
CURA-6225
CURA-5229 - Move @call_on_qt_thread to a separate module - Make sure that project writer runs on Qt thread because itself and the calls it makes can create new QObjects such as InstanceContainers, and this must happen on the Qt thread.