fix ag_scandir() for visual studio