POSIX: Improve threading abstraction as done in f06c4f5b