Bug fixes.

  - In mkdir(), create parent directories automatically, as in creat().
  - If a parent directory exists, mkdir() should not fail.
  - Do not crash if closedir() is called twice.