Include pthread.h in tasks.h, fixes compilation under OpenBSD