Fix L2 agent does not remove unused ipset set

The patch fixes L2 agent does not remove unused ipset set when security
group contains rules for only IPv4 or IPv6.

Change-Id: I375b1683cd763c0a33dc935558c637874d36ffa1
Closes-bug: #1373287
enable F812 check for flake8

The change removes the shadowed variable in list comprehensions and
enables the F812 check

Change-Id: If7b4d6f198795565fe0d8e7524b73555e310cd14
Partial-Bug: 1329017
Merge "Fix L2 agent does not remove unused ipset set"
Merge "enable F812 check for flake8"