Safe call lua code from cpp