readlink -f doesn't work on Mac OS; don't use -f

I don't know any good cross-platform way to do this simply, so I inlined
the first solution from
http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac.
(I added quotes in appropriate places to make the script still work with
spaces or backslashes.)

Reported By: Peter LeFanu Lumsdaine