[Serializer] Handle circular references. symfony/symfony#12098.

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | symfony/symfony#12098
| Applies to    | 2.6 or 2.7
| Fixed tickets | n/a

Please wrap lines after the first word that exceeds the maximum length of 72 characters per line.