Fix broken mailmap documentation link

It was not the full path to the docs, but let's also just refer to the version
on master.
Only use the host's name in the test

The test uses `$(hostname)`, which can produce the FQDN; however, the
code only uses the host name portion of that. Modify the test to do the
same by defining a `hostname` function that calls the hostname(1)
binary then pipes it through sed(1).

Use command instead of hardcoding the path.

OS X uses `$HOSTNAME` instead of the result of hostname(1). In the test
suite, use `$HOSTNAME` first, falling back to hostname(1).