lua: fix crash on calls to callbacks during load of script