Ensure redecls are part of the chain when unloading (ROOT-6832).

(cherry picked from commit 73011d2419d3a40d6e99cc2875b2f1b6b1d538e6)