Fix pyflakes warnings in utils.py

pyflakes says, "import 'os' from line 24 shadowed by loop variable"
and breaks "make qa".
Merge pull request #1184 from martin-helmich/fix-pyflakes-warnings

Fix pyflakes warnings in utils.py