This is an attempt to fix http://llvm.org/bugs/show_bug.cgi?id=18488, where std::list shows undefined behavior by casting a pointer to a list_node_base to a list_node.
I have added two private routines to list: link_nodes_at_front and link_nodes_at_back, to deal with these cases.
For simplicity, I added a method self to list_node_base, because that expression was used all over the place.
This passes all tests for C++03/11/14, and with ASAN. However, the undefined behavior was observed only with gcc 4.7.2, which I don't have. I'll work on getting that set up.
Also, I am not 100% sure that there isn't a similar set of UB lurking in the insert* routines.