check for active_thread != NULL in syscalls.c before using it

fixes #498