Use scandir(3) instead of DIY version