Added error messages for readdir_r() failures.