Add missing id attribute to RCA AI candidate action to_config()

With this missing, certain combinations of actions/events would lead to
the ids of all CAs being dropped (e.g. in saves after using
[modify_ai]), which resulted in it not being possible to remove CAs any
more as that is done by id.
This fixes bug #21750.