Fixed the serializer initialization for 2.0

Refs symfony/symfony#7145
Merge pull request #2258 from stof/patch-1

Fixed the serializer initialization for 2.0