shared: Free layers on direct close

Signed-off-by: William Douglas <william.douglas@intel.com>
shared: Remove unneeded hashmap

_directPermitted is obsolete with only the daemon and buxtonctl direct
able to use it.
Add warn_unused_result attribute

Include warnings to exported functions for when their return values
are unused and fix and warnings that showed up.

Signed-off-by: William Douglas <william.douglas@intel.com>