Fix multi-threading issues around imports on the scriptengine and use.