perf tools: Use readdir() instead of deprecated readdir_r()