Clean up PyFlakes warnings and improve filtering.

This cleans up some pyflakes warnings that were found. There were only a
couple minor ones found in unit tests, and one entry that needed to be
added to the exclusion file.

This also fixes up run-pyflakes.py to exclude more files/paths by
default, and to support excluding subdirectories listed in
module_exclusions (in particular, reviewboard/htdocs/, which is handy if
you upload a Python file to a review request that has pyflakes errors).

Reviewed at https://reviews.reviewboard.org/r/6063/