lib: Add a function to delete all interfaces

if.c: (if_terminate) This adds a cleanup function that can be called
    when a daemon exits, similar to vty_terminate().
diff --git a/lib/if.c b/lib/if.c
index 41115b0..31c60e3 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -872,3 +872,21 @@
 
   memset (&if_master, 0, sizeof if_master);
 }
+
+void
+if_terminate (void)
+{
+  for (;;)
+    {
+      struct interface *ifp;
+
+      ifp = listnode_head (iflist);
+      if (ifp == NULL)
+	break;
+
+      if_delete (ifp);
+    }
+
+  list_delete (iflist);
+  iflist = NULL;
+}