Check /etc/hostname before socket.getfqdn() in get_id()

This fixes #6645 by checking /etc/hostname first before trying
socket.getfqdn().
Add documentation on how the minion id is derived
Use raw string in regex

This quiets pylint, as it complains when a regex contains a backslash
and the string is not a raw string.
Merge pull request #6734 from terminalmage/issue6645

Check /etc/hostname to derive minion id