Use -Werror=deprecated for the readdir_r check

Otherwise, we'll just get the deprecation warning and use it anyway,
which then fails during build due to -Werror.