Update gstate.lua

* Add M.Trace as the global trace flag (boolean)
Update schedule.lua

* Fix calling M.reschedule() in M.xresched()