Fix inclusion of various header files

Fix inclusion of various header files when building the debug version
binaries. Also only conditionally define LIST_POISON1/2 if needed.