move OS-specific thread id related functions to compact.h