properties.c: better handling for name and value sizes

As discussed over irc, handling better possible issues with larger values and keys.

Also copy only the value size when getting via socket, as we got binaries providing a value pointer < VALUE_MAX.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>