Improved exception safety in posix::directory#for_each().