Set the next and prev pointers of the removed list element to NULL. This
will catch programming errors that would use invalid list pointers,
double-remove for instance.
It also helps debugging, making it easy to see in gdb if an object is
not in a list.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>