erts: Reduce number of list traversals in term_to_binary
erts: Reduce number of list traversals in term_to_binary

by patching list length when we reach end of list.

And remove unnecessary traversals in is_string and is_external_string
beyond the max length for STRING_EXT.

vinoski/otp,uabboli/otp,g-andrade/otp,legoscia/otp,bjorng/otp,dgud/otp,dumbbell/otp,ferd/otp,electricimp/otp,bjorng/otp,RoadRunnr/otp,isvilen/otp,legoscia/otp,erlang/otp,potatosalad/otp,emacsmirror/erlang,legoscia/otp,aboroska/otp,kvakvs/otp,bjorng/otp,dgud/otp,bjorng/otp,potatosalad/otp,bsmr-erlang/otp,uabboli/otp,kvakvs/otp,RoadRunnr/otp,erlang/otp,dumbbell/otp,g-andrade/otp,getong/otp,g-andrade/otp,lrascao/otp,kvakvs/otp,electricimp/otp,vinoski/otp,dgud/otp,bjorng/otp,emacsmirror/erlang,vladdu/otp,lrascao/otp,potatosalad/otp,emacsmirror/erlang,bsmr-erlang/otp,vinoski/otp,erlang/otp,isvilen/otp,rlipscombe/otp,getong/otp,RoadRunnr/otp,bsmr-erlang/otp,uabboli/otp,g-andrade/otp,RoadRunnr/otp,vinoski/otp,RoadRunnr/otp,g-andrade/otp,rlipscombe/otp,lrascao/otp,vinoski/otp,mikpe/otp,emacsmirror/erlang,erlang/otp,bsmr-erlang/otp,vladdu/otp,legoscia/otp,aboroska/otp,emacsmirror/erlang,dgud/otp,jj1bdx/otp,dgud/otp,uabboli/otp,vladdu/otp,vinoski/otp,isvilen/otp,isvilen/otp,vinoski/otp,bsmr-erlang/otp,isvilen/otp,emacsmirror/erlang,lrascao/otp,legoscia/otp,bsmr-erlang/otp,getong/otp,erlang/otp,bjorng/otp,kvakvs/otp,mikpe/otp,electricimp/otp,mikpe/otp,rlipscombe/otp,getong/otp,kvakvs/otp,dumbbell/otp,ferd/otp,potatosalad/otp,rlipscombe/otp,vladdu/otp,uabboli/otp,dgud/otp,mikpe/otp,getong/otp,lrascao/otp,RoadRunnr/otp,uabboli/otp,kvakvs/otp,getong/otp,vladdu/otp,aboroska/otp,bjorng/otp,vinoski/otp,potatosalad/otp,ferd/otp,mikpe/otp,bsmr-erlang/otp,jj1bdx/otp,rlipscombe/otp,isvilen/otp,aboroska/otp,kvakvs/otp,uabboli/otp,ferd/otp,isvilen/otp,dumbbell/otp,aboroska/otp,aboroska/otp,vladdu/otp,aboroska/otp,jj1bdx/otp,isvilen/otp,RoadRunnr/otp,electricimp/otp,dgud/otp,aboroska/otp,ferd/otp,erlang/otp,getong/otp,dgud/otp,ferd/otp,RoadRunnr/otp,g-andrade/otp,dumbbell/otp,isvilen/otp,potatosalad/otp,electricimp/otp,dumbbell/otp,rlipscombe/otp,dgud/otp,vladdu/otp,vladdu/otp,lrascao/otp,jj1bdx/otp,mikpe/otp,vladdu/otp,potatosalad/otp,dumbbell/otp,legoscia/otp,emacsmirror/erlang,aboroska/otp,getong/otp,rlipscombe/otp,g-andrade/otp,lrascao/otp,getong/otp,erlang/otp,g-andrade/otp,g-andrade/otp,erlang/otp,erlang/otp,dgud/otp,emacsmirror/erlang,bjorng/otp,rlipscombe/otp,bsmr-erlang/otp,legoscia/otp,dumbbell/otp,erlang/otp,bjorng/otp,potatosalad/otp,vinoski/otp,emacsmirror/erlang,rlipscombe/otp,mikpe/otp,legoscia/otp,jj1bdx/otp,g-andrade/otp,getong/otp,mikpe/otp,emacsmirror/erlang,mikpe/otp,legoscia/otp,jj1bdx/otp,dumbbell/otp,bjorng/otp,lrascao/otp,kvakvs/otp,ferd/otp,electricimp/otp,lrascao/otp,vinoski/otp,electricimp/otp,potatosalad/otp,rlipscombe/otp,kvakvs/otp,uabboli/otp,bsmr-erlang/otp,ferd/otp,mikpe/otp,jj1bdx/otp,ferd/otp,jj1bdx/otp,jj1bdx/otp,potatosalad/otp,electricimp/otp,uabboli/otp,dumbbell/otp,electricimp/otp,jj1bdx/otp,isvilen/otp,RoadRunnr/otp