T-Res interface: when a task is deleted, free its processing function memory and clear its state.
Merge pull request #12 from alessandrelli/free_pf_when_task_deleted

T-Res interface: when a task is deleted, free its processing function memory and clear its state.