pslog: fix unterminated string and memory leaks
Adding null terminator to buf string.
Cleaned a memory leak calling closedir on /proc/$PID/fd, that was left open.
`==29483==
==29483== HEAP SUMMARY:
==29483== in use at exit: 0 bytes in 0 blocks
==29483== total heap usage: 256 allocs, 256 frees, 70,990 bytes allocated
==29483==
==29483== All heap blocks were freed -- no leaks are possible
==29483==
==29483== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==29483== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)`
See merge request !2