added utility function to remove ips safely

Normally, removing a primary address of an interface will lead to
removal of all dependent addresses, this function will then re-add
them.

Signed-off-by: Jan Dvořák <mordae@anilinux.org>