Correctly count the number of pylint violations

@sarina Review? I think it's better than https://github.com/edx/XBlock/pull/215