Makefile: Add hacks for the nested modules for make check.
foreach: fix overzealous test.

Andreas Schlick reported a failure on 64-bit systems; we should simply
test that the number of iterators does not grow on second iteration,
rather than assuming an explicit limit as compilers may vary.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
net: make tests more robust.

Andreas Schlick reports failure on systems without IPv6 support (in particular
ones with no IPv6 addresses for localhost).  We should be more robust in
these cases, and also where IPv4 support is missing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>