There is really no documentation about how the linked lists in the
lists.h should be used. Specifically, it does not mention the fact
that the head entry of the list should never be used at all. Instead,
the head entry, when being empty, just points to itself.
Now that this fact is clear, a lot of difficult assumptions can be
left out and some overly complicated code can be cleared with the list
handling. This is because the head entry does not have to contain a
valid entry at all.
This also fixes a bug with was caused by the incorrect list handling:
printing the process list always had the head entry missing, since the
list_for_all() functions left the head entry unhandled for purpose.
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>