documentation: Add missing documentation for pthread functions and structures

As wished in #980.

WIP.