protect against relation loops, part 2.

Like https://github.com/openstreetmap/iD/commit/7bbca76a2012a4337d54efdb3c9ba2dec5192bdf. Fixes #2096.