[Validator] Added ConstraintViolation::getConstraint()

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This PR adds a `getConstraint()` method to the `ConstraintViolation` in order to access the constraint causing the violation.

Related to #7276, #7273 and #9691.
Leaving the BC issue away, ``null`` can also be removed, can't it? Classes that created objects before, already passed a string as the second argument before which would break now since a string isn't a ``Constraint`` instance. So, if they already have to be changed, there'll be no needed in passing ``null``, but passing the actual failing constraint instead.