Extract Doxygen comments within #ifdef __cplusplus.

Also add documentation for some undocumented thread_mpi members exposed
by this.

Change-Id: I93ff0770d4032b92dc829257f773c11a93d78caa