Fix compilation when configured with --disable-pthreads.