pthreads.h: avoid undefined behavior You can't pass a function pointer through a void pointer. So wrap the pthread callback in a struct. Fixes #966