Split out syscall-executing logic to make upcoming changes to task execution state simpler.