The if_delgroups function failed to free the ifg_list structure pointer
memory. This results in a small leak on M_TEMP for each ifp group every
time an interface is detached.
This was caused because if_delgroup and if_delgroups duplicate the logic
for releasing the group memory.
Fix this by factoring out an if_freegroup function which can be called
by both if_delgroup and if_delgroups.
This results in slightly funky code, because we must drop the
IFNET_WLOCK before calling the event handler. However, we want the
IFNET_WLOCK around the group list search in if_delgroup and in the group
list iteration in if_delgroups. Further, if_delgroups must re-take the
lock after calling the new if_freegroups.
Signed-off-by: Jacob Keller <firstname.lastname@example.org>