[BugFix] Synchronously create the cacheDir before writing to it.

I experienced `ENOTDIR, not a directory` errors thrown by the `copyFromCache` method
I am not sure how to reproduce it, I used the amd formater, and I only had one file to transpile.

 Thanks for the great work.