Serialization of responses is slightly tricky, because the serialization
we want has to differ from usual 'simple' JSON or Smile structure.
Instead of serializing a full structure, we serialize a sequence of
metadata-payload pairs; both of which are preceded by 4-byte length
indicators; and then a 0-length marker at the end.