Add mutex for shared scripts dict