Create directory tree if necessary