Robust Prompt Optimization for Large Language Models Against Distribution Shifts