Disallow negative counts in repeat expressions

This fixes #6977. Negative counts don't make sense anyway.