add composite primary key to quark_port_ip_address_associations

Corrects a shortcoming of the quark_port_ip_address_associations table where it doesn't have a composite primary key and port_id/ip_address_id could be NULL, therefore leaving room for orphans and diminishing the value of the table.
Using itertools.chain instead of separate function to flatten.