Add check for sched_yield in librt

In Solaris, sched_yield lives in librt, rather than libc. This patch adds a
check which will link in librt if necessary.