Fix problems shown by testing on NetBSD 6.

 * Several more headers may depend on sys/types.h.
 * New error category for headers making use of sys/queue.h macros.
 * Record known errors detected during contents tests.
 * Prevent duplicates in error lists.