Add runtime checks and a fallback if we can't get the thread scheduler settings
On Linux the sched_getattr syscall might be available at compile-time but not actually work at runtime (e.g. because an older kernel is running or valgrind is used). Instead of killing the process, return FALSE and handle this gracefully at runtime with some fallback code.
Fixes #2007 (closed)