segmentio: fix incorrect tests

The existing tests were comparing dicts based on their JSON
representation, which is wrong since the order of the keys in the string
output is not guaranteed.
The current patch does the inverse conversion: JSONs are unserialized to
dicts to be compared to dicts, which will enforce a correct comparison.