Manually resolve symlinks in test helpers

Mac OS X's `readlink` command does not support the same options as GNU,
FreeBSD, and other operating systems, nor does it support canonicalizing
symlink resolutions.

In place of `readlink`, we're going to borrow [this] suggested implementation
from the community.

[this]: 
http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
I've removed this exit code in c12172b, but I kept the other ones in since that's out-of-scope-ish.