Don't encode user_metadata if it's empty.

Fixes #417 

Encode function in k.h.d.sensors was updating user_metadata even when it wasn't edited. This PR adds a check to encode that will allow to edit user_metadata only when new metadata is passed. Existing metadata will remain unchanged.