build: make sched_* usage optional
Add configure checks for sched_* APIs and guard usage of
sched_setscheduler with HAVE_SCHED_SETSCHEDULER.
This avoids build/runtime issues on platforms without
scheduler support.
Change-Id: I5af357c1e2074fa1e05ac6bc20af8535c474d906