[#1790] fix Count to avoid infinite loop

[Lighthouse issue #1790](http://play.lighthouseapp.com/projects/57987-play-framework/tickets/1790-count-run-in-infinite-loop)