shared: Set layer type on get_value

When setting which layer to use to get a key in get value, also set the
layer type. Fix test that breaks because of the new correct behavior.
shared: Improve logging
shared: Zero memory before string copy
shared: Check group exists first before label test

In get_value_for_layer if smack isn't enabled then the label will not be
set and so a valid test for group existance will be skipped. To avoid this,
check the group exists if the key has a name otherwise continue as normal
and the smack check will only test group access if a client label is
passed.

Also fix up tests to not pass a client label if smack is not enabled on the
system.
test: Fix tests by ensuring group exists prior to set_value