Declare sched_active_thread and sched_active_pid locally in the ESP code for now. Once the code is cleaned up to no longer tap into scheduler internals but use the API instead, those can be dropped again.