RM7980

A commit back in may introduced filtering on "do_not_use" when selecting
IP addresses from the database. Unfortunately, this had the unintended
side-effect of applying a cartesian product to the result set, crushing
neutron DB servers in the process. This patch refactors the join to be
more sensible, as well as an inner join for safety.