Add a few typed exceptions and override P6Regex::Grammar methods to throw them.

This lets us test sensibly for RT #77380, RT #77522 and similar.

This implements the Perl 6 side of (nqp PR #173)[https://github.com/perl6/nqp/pull/173].