work around linux bug in readlink syscall with zero buffer size