fix(client): Fix stringify serializing objects

Stringify uses the name of the constructor to serialize objects.
When the object was created using Object.create(null) or has a property
constructor this may throw an Error