fix readdir_r usage on AIX