Fixed invalid escaping DQL parameters

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | sonata-project/SonataAdminBundle#2378, sonata-project/SonataAdminBundle#1977
| License       | MIT

This escaping bug occures if the primary key was a string and not an integer.