fix: make sure the top level directories for config and cache exist

The lib will fail to initialize if the directories for config or cache don't exist. Especially the cache directory might be absent.