backport: error handling for config hostname retrieval

Included changes:

- log warnings properly
- issue warning when FQDN retrieval fails for system.identity and system.nsid
- cache hostname lookup

refs #306

Original commits:

9de0e69  Merge branch 'conf-hostname-error' into 'master'
7bcf3ff  log: cache hostname lookup for nsid and identity
9ab4ea4  log: warn on error retrieving auto value for NSID and identity
3ad605d  log: update warnings to use cf_warning
87b7676  conf: added cf_warning API