Fix build failure when dynamic allocation is not enabled.
Fix build failure when dynamic allocation is not enabled.

When dynamic allocation is not enabled, vPortFree is not available. The current code used
vPortFree and this resulted in linker error. This commit removes the use of vPortFree when
dynamic allocation is not enabled.

FreeRTOS/FreeRTOS-Kernel,FreeRTOS/FreeRTOS-Kernel