fix a potential bug with readlink(2)

According to linux manual READLINK(2)
```
   readlink() places the contents of the symbolic link pathname in the buffer
   buf,  which has size bufsiz. readlink() does not append a null byte to buf.
   It will truncate the contents (to a length of bufsiz characters), in case
   the buffer is too small to hold all of the contents.
```
there is a situation that readlink returns bufsize when the path is long enough
, and in that situation we would write \0 to the invalid address buf[bufsize].
obviously it is not allowed.
I see. This fixes the bug when the bufsize is not enough. But when bufsize is large enough, we still need to use `buf[l] = 0`, because readlink would not append the trailing null byte. Alternatively we can make sure `buf` is all zero by `char buf[BUFSIZE] = {0}`.