AutoMedPrompt: A New Framework for Optimizing LLM Medical Prompts Using Textual Gradients