Corrected bugs in USBHDFSD:
1. Malformed dotdot (aka "..") entries were being created within new directories residing on the root of the disk. Such directories should have NULL specified as the parent directory cluster number.
2. Fixed structure type (fs_rec or fs_dir) casting for fs_ioctl, so that the functions can be used for both directories and files.
3. Added missing test conditions, to prevent file-only operations from being done to directories and vice-versa.
4. Changed the error code for an incorrect directory type for all I/O functions to EISDIR and ENOTDIR, instead of EACCESS.
5. Modified the directory-handling functions to preserve the original record for the opened directory (with dopen), so that directories can be renamed too.