various minor fixes

  - make sure entire cache directory path is created
  - fix typo in mkdir
  - fix error that mkdir cannot be found in chroot