tasks: Save state of running task when it called a syscall