Promote do_lookup_x:check_match to a full function.

While it may be argued that nested functions make the resulting
code easier to read, or worse to read the following two bugs
make it difficult to debug:

Bug 8300 - no local symbol information within nested or nesting
procedures
https://sourceware.org/bugzilla/show_bug.cgi?id=8300

Bug 53927 - wrong value for DW_AT_static_link
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53927

Until these are fixed I've made check_match a full function.
After they are fixed we can resume arguing about the merits
of nested functions on readability and maintenance.
Add header and standard information to threads.texi.

The glibc manual uses special annotations to include functions
in the summary chapter. These annotations were missing from the
functions in the threads chapter. This patch adds those special
markers and in turn adds these functions to the summary chapter.