ChemAgent: Self-updating Library in Large Language Models Improves Chemical Reasoning