Ensure needed directories exist