lib/facter: Encapsulate Facter setcode

Avoid potential problems, and add setcode only if edploy command is
present and executable.