fdo#74743 avoid infinite loop when gathering "svg" element styles

Change-Id: Ifcfd0c64302b9174510e3d774607f5ca60173885
Signed-off-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 8d15b2c3dbad718782d3923ece0eb6816beafab0)
Reviewed-on: https://gerrit.libreoffice.org/9062
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>