ICD-LM: Configuring Vision-Language In-Context Demonstrations by Language Modeling