Ensure CONFIG_DIR exists before saving CONFIG_FILE

Fixes #700