sql: Fix prefix stats for large IPv6 prefixes

Large IPv6 prefixes results in very large numbers of used or free
addresses and since the num_used variable used was a plain integer it
couldn't handle such large numbers. Now changed to numeric!

Also remove an unused variable.