How to I safely anchor a safety line to a chimney?
There is no reliable data I know of for the ultimate strength of expansion anchors in brick masonry. It's not a viable anchor system no matter how many you use (within reason). You are almost better off with no protection because then you will make damn sure you do not fall. (Just kidding, but there is some logic to this amongst rock climbers).

An anchor system around the entire chimney is a much better option if properly placed. As you note, there is a risk of the entire chimney failing. This risk is difficult to assess, depending on the chimney's age, method of construction (reinforced?), type of brick, the mortar mix used, it's anchorage to adjacent structure, etc. The anchor should be placed as close to the highest chimney anchorage as possible, though it increases your fall distance, it decreases the bending moment in the structure.

If the resulting fall distance is unacceptable, or there is no anchorage, you need to consider alternatives. An anchor system installed into the structure of the building is most secure. This allows possibly a higher anchor (less fall distance) and a more desirable fall factor (proportionally more rope involved for a given fall distance reduces shock loading). This will involve locating structural members and using appropriate fasteners, as well as dealing with sealing around the anchor to prevent roof leaks.

There are manufactured fall arrest anchors suitable to such applications. By following recommended installation instructions, these anchors in the US are OSHA approved and will resist 5000 lbs of force. This is the only sure way of achieving an adequate anchor system.

In the US, OSHA fall protection requirements are applicable to work done on single family residences.

That's the official line as I know it. That said, I have a similar situation where I sank a single 5/16"x3" solid, shouldered eye screw (hot dipped galvanized) into the center of one roof rafter, straight through the roofing, sealant applied before applying the final few turns. It's been there for decades with no evidence of leakage or corrosion. It does not meet OSHA standards but I consider it marginally adequate in the event of a fall for my particular situation. It will not be adequate for other situations.