common: Fix string and vector<string> seralization

There was a bug in serialization of std::string and
std::vector<std::string>, which (depending on an architecture) may led
to serializing field length as a 64 bit variable, while it was always
deserialized as a 32 bit variable.