CheckMemoryLeak: Move posix-opendir/closedir to library