[System.Runtime.Serialization] Static writer fix.
While serializing any type into a contract member of type object an
exception would be thrown.
To avoid this XmlObjectSerializerWriteContext.InternalSerialize should
in this case be called using the object type instead of the member type,
similar how reference sources does in type instead of the member type,
referencesources seems to be doing omething similar [1].
Fixes #37116.
[1]
http://referencesource.microsoft.com/#System.Runtime.Serialization/System/Runtime/Serialization/XmlObjectSerializerWriteContext.cs,619