src: split darwin threading code from the generic posix implementation