Refactored the countByFinished of MyBatis2's TodoRepositoryImpl. #157

I cherry picked from master branch.
Please review #157, and merge to 1.0.x branch.