Small clean-ups and leak fixes in the OPENDIR mechanism.

Replace this with just `struct Stat_; /* forward declaration to ensure it's in outer scope; defined in stat_cache.h */` and use `struct Stat_ cache;` for the field member below.