Change stats max_count variables to unsigned.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Check shift used in freq_est and stats max_count calculation.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>