smack: move access check logic to smack.c

The current access check logic is getting complex, so move it to
smack.c, and call generic functions from daemon.c instead.
daemon: add a reminder comment about moving an access check