core: thread_yield_higher cleanup

This is a cleanup PR for #1836.