Work around broken FreeBSD headers

It seems that including just pthread.h does not define
clockid_t on these systems.

https://bugzilla.gnome.org/show_bug.cgi?id=722526