[packaging] Fix problems with QJSValue thread access