Use own scandir function. according to this change, we don't need -Werror things in configure anymore.