[DoctrineBridge] Changed UniqueEntityValidator to use the 2.5 Validation API

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11578
| License       | MIT
| Doc PR        | -
Well we could in fact add an `instanceof` check on the context to find out whether the context supports the new methods. But if we do that consequently, that means quite some additional if statements in the validators. Nevertheless, I guess that would be a more elegant solution overall.