Cache-of-Thought: Master-Apprentice Framework for Cost-Effective Vision Language Model Inference