Safe deletion of list, while traversing the list.

Use list_for_each_entry_safe() instead of list_for_each_entry()
for safe deletion of nodes.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>