common: Add serialization of all not null-terminated strings

This commit makes it possible to serialize and deserialize strings with
length specified by any integer type (eg. uint8_t, uint32_t) which are
not null-terminated. Such strings are used in some existing commands
like MATOCL_SESSION_LIST (32-bit length)  or CLTOMA_FUSE_MKDIR (8-bit
length).

Change-Id: I1686220dab43856ed700b33e05542631a31be447