cast internal_counter to expected type

Fixes issue spotted by travis: https://travis-ci.org/prymitive/uwsgi/jobs/16407101#L610