Better POSIX compliance in realpath(3).

millert@ made changes to realpath.c based on FreeBSD's version.  I merged
Todd's changes into dl_realpath.c.

ok millert@, guenther@