Fixed a bug in the posix::directory#for_each() implementation.