Deletion of a task after reaching to the end of function

@Mehran

A function that implements a task should never return (i.e., reach the end of the function), as there is nothing to return to. Depending on the port and if the configASSERT is defined, it will trigger an assert (for example, in the case of Cortex M4 port, inside the prvTaskExitError) if a function just returns. The task’s resources are not released.

If a task wants to exit, it should instead call vTaskDelete( NULL ) when its about to exit. In that case the idle task is responsible for freeing resources allocated for the task that have been deleted. Note that the idle task will only delete the memory allocated by the FreeRTOS scheduler for that task; it wont delete any memory/resources that the task istelf dynamically allocated/acquired during its runtime.