Fix a potential crash when loading script locals from savegame