T-Res interface: when a task is deleted, free its processing function memory and clear its state.
T-Res: fix incorrect behavior of getState(). The corresponding native function now creates a new float or int object instead of changing the existing one.