Fallback to socket.getfqdn() instead of localhost

This builds on https://github.com/saltstack/salt/pull/11674
Merge pull request #11706 from terminalmage/quickfix

Fallback to socket.getfqdn() instead of localhost