Provable Benefits of Task-Specific Prompts for In-context Learning