grains/core : fix fqdn / domain return on SunOS systems

getfqdn() on Solaris platforms returns the unqualified hostname. In
that case, using gethostname() could be a solution.

Tested on SmartOS / Solaris 11
Merge pull request #5088 from virtua-network/grains_hostname

grains/core : fix fqdn / domain return on SunOS systems