Include `pthread.h` before using pthreads functions

Fixes build on OpenBSD