Added fix to infinite loop in ipam.allocate_ip_address