Previously, sched_statistics_cb() was always called with two valid PIDs. Now it is possible (when the idle thread is not used) that one of the two might be KERNEL_PID_UNDEF, as the callback might be called when descheduling the last thread, or scheduling the first.