create parent folders for the data directory if they don't exist yet

Currently the creation if the data directory fails if the parent directory doesn't exists. This fix creates the data directory recursively so that missing parent directories get created.