Remove duplicated code in serializers.
|Reported by:||Owned by:||nobody|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Removed some code duplicated in json and yaml end_serialization methods. Generic parameters passed in options are already stored in self variables waiting in subclass to pop them from dict is useless.
Moreover, if we want to subclass python serializer for a custom format, we needed(not actually needed but nice to behave like the other two) to copy these lines again. Another example would be to subclass json serializer to override the encoder. We would have to copy those lines again.