Fixed problem caused by nested interrupts happening during a thread switch. Workaround was to just exit the systick interrupt if it is interrupting another interrupt.