fix 'unused return' of readlink when compiling

make use of the return value of readlink and print error if occurred