rtos: fix segfault in FreeRTOS handling