Centralize code for ensuring that directory exists
Centralize code for ensuring that directory exists

In some places, we used an EAFP approach for ensuring directory
existence, in other places it was LBYL. Let's centralize this in a
single function.

webmaster128/clcache,webmaster128/clcache,webmaster128/clcache