core/sched: fix (non-)use of thread_*_pid

some errors were introduced by #1306, some existed before