In the "if_purgeaddrs()" function, trying to hold the network epoch over calling in_control() leads to a deadlock, because this function in turn may lock various SX locks depending on which network device is there. Investigating this issue revealed a deeper problem, that in order to avoid races, epoch_wait() must be called between removing an interface address entry and before calling ifa_free(). Else concurrent threads may still ref the old interface address, IFA, still visible and this can lead up to a double free situation. To detect this situation let ifa_ref() use the function refcount_acquire_if_not_zero() to detect when the IFA is still visible, but can no longer be referenced, because it is scheduled for free. This way both iterating and freeing IFA's in an epoch section becomes possible and this also simplifies the code in question.
epoch_enter()
```
sx_xlock();
sx_xunlock();
epoch_exit();
sx_xlock();
epoch_wait();
sx_xunlock();
```