Fix and enable flake8 F812

F812 list comprehension redefines

List comprehension don't have scope so redefining variables can lead to
unexpected behaviors

Change-Id: I85484dfcd4fa391195ea7be75aadc7897da4739c
Merge "Fix and enable flake8 F812"