It'a probably a bad connection. Flashing twice as fast is usually an indication that a bulb has blown. You should remove a bulb and see if the flasher does flash twice as fast with the headlights off.
If that is the case, and it flashes twice as fast with both bulbs and the headlight on, that implies that less current is taken by the indicators when the headlight is on, which would point to a bad connection that is reducing the voltage when the larger load of the headlight is on.