sched_unpin(): assert that curthread was pinned
(cherry picked from commit 7e5574f9e5d9df749ffc49657717527cfa93f6b4)