Closes a directory descriptor.
This function closes the directory descriptor reffered to by the dir.
dir