Fixes for dir_content
- Close the directory no matter how we exit the function
- Don't poison errno in case of ignored errors
- Don't prepare half-structures on the stack in case of ignored errors (this could produce a broken result with things missing or maybe even with the wrong type ‒ no investigation into what could have been returned done).