[^maxmedvedev] gdsl: be prepared to multithreaded scripts
(cherry picked from commit a240a44)