LLM as an Algorithmist: Enhancing Anomaly Detectors via Programmatic Synthesis