Make the readlink method raise an error if the argument is not a symlink to comply with the spec; also updated a realpath test.