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

Yes; it is very likely the same bit of stack shall get used for the same variable on many iterations; then again, nothing precludes that bit of stack (or register) being used for some other variable outside the lifetime of this one, so the behaviour is undefined.  You got "lucky" but it's better to take luck out of the equation ;^>