Ensure encoding to JSON doesn't crash if a datetime is inserted into ...

...field_metadata