Function setTaskEventCallback
Sets a callback that is invoked whenever a task changes its status.
This function is useful mostly for implementing debuggers that analyze the life time of tasks, including task switches. Note that the callback will only be called for debug builds.