Add libwrap at the end of the configure run

If libwrap becomes added earlier, other tests may fail because of not all
external variables required by libwrap are available when linking: for
example allow_severity and deny_severity.

This patch adds generic support for the LDFLAGS_END and LIBS_END variables
(CFLAGS_END has been implemented already).

Problem spotted on OpenBSD.
Fix configure script and "make check" for TCP Wrappers

Add missing #include's and static variables.

Problem spotted on OpenBSD.