Fix broken readdir_r() and readdir_r64() functions.