Do not check twice IP allocations for auto-address subnets
For auto-address subnets such as those with SLAAC and DHCP_STATELESS
address modes it is ok to delete them even when there are active IP
allocations.
The current logic might trigger unexpected 409 errors if IP
allocations are made on these subnets concurrently with their
deletion.
This patch simply ensures the final check for active IP allocations is
not performed for this class of subnets; since all IP allocations will
be removed anyway, it does not make sense to check whether there are
allocations at all. In fact, doing this check might cause a failure
of the delete operation if an IP allocation is made concurrently.
This patch also factors out the logic for checking whether there are
IP allocations on the subnet to avoid code duplication.
Closes-Bug: #
1414199
Change-Id: I1c4ca6f677845f6e2e8d88f3629c0e91ca73b5d0