Optimize to get_children() and get_unused_subnets().

Now works fast with large number of rows in the Ipblock table.