core::rt: Fix two incorrect uses of the thread-local scheduler

These would not be threadsafe