erts: Fix bug in heap_factory_undo for FACTORY_HEAP_FRAGS mode
erts: Fix bug in heap_factory_undo for FACTORY_HEAP_FRAGS mode

Make sure a heap fragment is not deallocated before all off_heap
terms have been cleared.

The fix assumes/asserts that the off_heap-lists of all additional
heap fragments are empty.

I think this bug has been harmless as hashmap nodes, which is only
ones (?) that can cause a factory to produce more heap,
are not linked in off_heap-list.

bsmr-erlang/otp,hairyhum/otp,legoscia/otp,dgud/otp,RoadRunnr/otp,derek121/otp,lightcyphers/otp,weisslj/otp,dumbbell/otp,lemenkov/otp,matwey/otp,vladdu/otp,getong/otp,RaimoNiskanen/otp,ferd/otp,dumbbell/otp,johanclaesson/otp,ferd/otp,saleyn/otp,bjorng/otp,erlang/otp,electricimp/otp,lemenkov/otp,goertzenator/otp,lemenkov/otp,uabboli/otp,lrascao/otp,bsmr-erlang/otp,bernardd/otp,release-project/otp,uabboli/otp,tuncer/otp,bsmr-erlang/otp,massemanet/otp,emile/otp,rlipscombe/otp,g-andrade/otp,uabboli/otp,uabboli/otp,vinoski/otp,mikpe/otp,kvakvs/otp,hairyhum/otp,RoadRunnr/otp,potatosalad/otp,legoscia/otp,johanclaesson/otp,msantos/otp,dgud/otp,RaimoNiskanen/otp,bugs-erlang-org/otp,jj1bdx/otp,emile/otp,massemanet/otp,neeraj9/otp,uabboli/otp,psyeugenic/otp,uabboli/otp,matwey/otp,matwey/otp,potatosalad/otp,g-andrade/otp,goertzenator/otp,psyeugenic/otp,vladdu/otp,RoadRunnr/otp,dumbbell/otp,lightcyphers/otp,mikpe/otp,potatosalad/otp,vinoski/otp,weisslj/otp,weisslj/otp,vladdu/otp,bjorng/otp,RaimoNiskanen/otp,emacsmirror/erlang,legoscia/otp,massemanet/otp,emile/otp,ferd/otp,electricimp/otp,jj1bdx/otp,falkevik/otp,ferd/otp,rlipscombe/otp,fenollp/otp,hairyhum/otp,bjorng/otp,legoscia/otp,falkevik/otp,goertzenator/otp,neeraj9/otp,emile/otp,ahmedshafeeq/otp,ahmedshafeeq/otp,vinoski/otp,jj1bdx/otp,release-project/otp,legoscia/otp,neeraj9/otp,bernardd/otp,lemenkov/otp,falkevik/otp,mikpe/otp,ahmedshafeeq/otp,emile/otp,dumbbell/otp,goertzenator/otp,msantos/otp,vinoski/otp,isvilen/otp,RoadRunnr/otp,neeraj9/otp,electricimp/otp,RoadRunnr/otp,psyeugenic/otp,isvilen/otp,RoadRunnr/otp,matwey/otp,fenollp/otp,getong/otp,derek121/otp,matwey/otp,derek121/otp,bsmr-erlang/otp,kvakvs/otp,basho/otp,erlang/otp,falkevik/otp,goertzenator/otp,goertzenator/otp,saleyn/otp,vinoski/otp,cobusc/otp,emacsmirror/erlang,rlipscombe/otp,dumbbell/otp,ahmedshafeeq/otp,rlipscombe/otp,msantos/otp,hairyhum/otp,massemanet/otp,saleyn/otp,tuncer/otp,vladdu/otp,potatosalad/otp,isvilen/otp,RoadRunnr/otp,bugs-erlang-org/otp,bsmr-erlang/otp,electricimp/otp,derek121/otp,bsmr-erlang/otp,getong/otp,saleyn/otp,lightcyphers/otp,ahmedshafeeq/otp,aboroska/otp,emacsmirror/erlang,aboroska/otp,basho/otp,potatosalad/otp,electricimp/otp,weisslj/otp,hairyhum/otp,vinoski/otp,rlipscombe/otp,bsmr-erlang/otp,ahmedshafeeq/otp,emacsmirror/erlang,isvilen/otp,emacsmirror/erlang,jj1bdx/otp,RaimoNiskanen/otp,saleyn/otp,kvakvs/otp,cobusc/otp,ahmedshafeeq/otp,release-project/otp,lrascao/otp,erlang/otp,bsmr-erlang/otp,johanclaesson/otp,kvakvs/otp,release-project/otp,ferd/otp,lemenkov/otp,saleyn/otp,saleyn/otp,basho/otp,aboroska/otp,jj1bdx/otp,kvakvs/otp,emile/otp,johanclaesson/otp,basho/otp,fenollp/otp,vinoski/otp,rlipscombe/otp,mikpe/otp,massemanet/otp,isvilen/otp,matwey/otp,falkevik/otp,mikpe/otp,kvakvs/otp,RaimoNiskanen/otp,johanclaesson/otp,ahmedshafeeq/otp,saleyn/otp,tuncer/otp,release-project/otp,lemenkov/otp,msantos/otp,goertzenator/otp,uabboli/otp,jj1bdx/otp,bjorng/otp,derek121/otp,g-andrade/otp,aboroska/otp,johanclaesson/otp,dgud/otp,weisslj/otp,isvilen/otp,ahmedshafeeq/otp,jj1bdx/otp,bernardd/otp,bernardd/otp,massemanet/otp,kvakvs/otp,dgud/otp,jj1bdx/otp,getong/otp,jj1bdx/otp,hairyhum/otp,neeraj9/otp,bjorng/otp,dgud/otp,erlang/otp,electricimp/otp,erlang/otp,rlipscombe/otp,tuncer/otp,bernardd/otp,RaimoNiskanen/otp,weisslj/otp,bernardd/otp,bugs-erlang-org/otp,fenollp/otp,lemenkov/otp,weisslj/otp,vinoski/otp,falkevik/otp,uabboli/otp,isvilen/otp,basho/otp,mikpe/otp,derek121/otp,emacsmirror/erlang,tuncer/otp,emacsmirror/erlang,dumbbell/otp,psyeugenic/otp,aboroska/otp,dgud/otp,msantos/otp,emacsmirror/erlang,getong/otp,tuncer/otp,vladdu/otp,massemanet/otp,g-andrade/otp,bjorng/otp,lrascao/otp,psyeugenic/otp,bernardd/otp,mikpe/otp,release-project/otp,fenollp/otp,cobusc/otp,g-andrade/otp,dgud/otp,RoadRunnr/otp,lightcyphers/otp,emacsmirror/erlang,jj1bdx/otp,lrascao/otp,erlang/otp,potatosalad/otp,erlang/otp,lrascao/otp,rlipscombe/otp,potatosalad/otp,emacsmirror/erlang,lightcyphers/otp,neeraj9/otp,legoscia/otp,dgud/otp,fenollp/otp,RoadRunnr/otp,bugs-erlang-org/otp,electricimp/otp,neeraj9/otp,derek121/otp,electricimp/otp,bjorng/otp,legoscia/otp,psyeugenic/otp,cobusc/otp,ferd/otp,emile/otp,cobusc/otp,lrascao/otp,g-andrade/otp,vinoski/otp,hairyhum/otp,getong/otp,massemanet/otp,legoscia/otp,isvilen/otp,release-project/otp,ferd/otp,tuncer/otp,mikpe/otp,rlipscombe/otp,g-andrade/otp,bernardd/otp,RaimoNiskanen/otp,weisslj/otp,potatosalad/otp,dumbbell/otp,fenollp/otp,falkevik/otp,goertzenator/otp,lrascao/otp,msantos/otp,vladdu/otp,dgud/otp,g-andrade/otp,neeraj9/otp,vinoski/otp,aboroska/otp,potatosalad/otp,ferd/otp,saleyn/otp,lemenkov/otp,bernardd/otp,erlang/otp,massemanet/otp,bjorng/otp,emile/otp,lightcyphers/otp,kvakvs/otp,basho/otp,ferd/otp,lrascao/otp,dgud/otp,psyeugenic/otp,aboroska/otp,bugs-erlang-org/otp,matwey/otp,cobusc/otp,lrascao/otp,matwey/otp,RaimoNiskanen/otp,bugs-erlang-org/otp,mikpe/otp,kvakvs/otp,electricimp/otp,goertzenator/otp,erlang/otp,vladdu/otp,johanclaesson/otp,legoscia/otp,mikpe/otp,bsmr-erlang/otp,getong/otp,psyeugenic/otp,emile/otp,lightcyphers/otp,release-project/otp,getong/otp,dumbbell/otp,rlipscombe/otp,matwey/otp,aboroska/otp,derek121/otp,bjorng/otp,fenollp/otp,dumbbell/otp,fenollp/otp,g-andrade/otp,getong/otp,lightcyphers/otp,release-project/otp,bjorng/otp,bugs-erlang-org/otp,weisslj/otp,tuncer/otp,basho/otp,vladdu/otp,g-andrade/otp,uabboli/otp,johanclaesson/otp,msantos/otp,erlang/otp,dumbbell/otp,tuncer/otp,falkevik/otp,hairyhum/otp,RaimoNiskanen/otp,vladdu/otp,basho/otp,bugs-erlang-org/otp,msantos/otp,cobusc/otp,getong/otp,potatosalad/otp,isvilen/otp,basho/otp,aboroska/otp,cobusc/otp,isvilen/otp,falkevik/otp