File names are returned unterminated in the edge case where their length
is max size This is due to the fact that strncpy does terminate the
destination string when the source string is greater than or equal to
the specifid maximum length.
Clearing `_file` and `_dir` pointers after freeing on failure to open
just in case close() is later called.
To elaborate, the `_file` and `_dir` pointers are normally freed and
cleared by _close(), but when a failure occurs upon opening, these
pointers were being left orphaned since calling close() after failure to
open doesn't make much sense, and indeed caused serious issues within
lfs.
This solution appears to work. However, it does not
follow all best practices. For example, the use of
friend declarations, and the need to make the lock/unlock
functions in File public (in order to get friend status).
However, it passes the stress test without errors.