lua : add dt.control.dispatch

this function allows running a function "at a later date" to
do background jobs in lua
lua: add the exit event

this event is triggered when DT exits