Fix delete security group criteria

Only delete security groups associated with deleted tenant but not associated with any port.