Ensure template ads do not send out multiple requests when layout changes (#23099)
Ensure template ads do not send out multiple requests when layout changes (#23099)

* Init

* Use boolean flag instead of promise to guard.

* Use suggested approach.

adup-tech/amphtml,Gregable/amphtml,rsimha-amp/amphtml,danielrozenberg/amphtml,zhangsu/amphtml,jpettitt/amphtml,danielrozenberg/amphtml,rsimha-amp/amphtml,ampproject/amphtml,jpettitt/amphtml,voyagegroup/amphtml,ampproject/amphtml,nexxtv/amphtml,honeybadgerdontcare/amphtml,lannka/amphtml,src-code/amphtml,taboola/amphtml,src-code/amphtml,smartadserver/amphtml,prateekbh/amphtml,sharethrough/amphtml,zhouyx/amphtml,rsimha-amp/amphtml,prateekbh/amphtml,mhc-gh/amphtml,smartadserver/amphtml,sharethrough/amphtml,alanorozco/amphtml,adup-tech/amphtml,zhouyx/amphtml,taboola/amphtml,cory-work/amphtml,mhc-gh/amphtml,cory-work/amphtml,jmadler/amphtml,smartadserver/amphtml,adup-tech/amphtml,alanorozco/amphtml,rsimha-amp/amphtml,yandex-pcode/amphtml,cory-work/amphtml,prateekbh/amphtml,zhangsu/amphtml,lannka/amphtml,danielrozenberg/amphtml,jpettitt/amphtml,taboola/amphtml,Gregable/amphtml,ampproject/amphtml,erwinmombay/amphtml,jpettitt/amphtml,media-net/amphtml,tlong2/amphtml,sharethrough/amphtml,jmadler/amphtml,dotandads/amphtml,voyagegroup/amphtml,alanorozco/amphtml,mhc-gh/amphtml,media-net/amphtml,honeybadgerdontcare/amphtml,yandex-pcode/amphtml,zhangsu/amphtml,Gregable/amphtml,alanorozco/amphtml,tlong2/amphtml,jridgewell/amphtml,src-code/amphtml,media-net/amphtml,nexxtv/amphtml,smartadserver/amphtml,yandex-pcode/amphtml,src-code/amphtml,danielrozenberg/amphtml,lannka/amphtml,src-code/amphtml,jridgewell/amphtml,voyagegroup/amphtml,sharethrough/amphtml,ampproject/amphtml,jridgewell/amphtml,lannka/amphtml,nexxtv/amphtml,taboola/amphtml,erwinmombay/amphtml,zhouyx/amphtml,media-net/amphtml,zhouyx/amphtml,honeybadgerdontcare/amphtml,prateekbh/amphtml,src-code/amphtml,erwinmombay/amphtml,ampproject/amphtml,jmadler/amphtml,media-net/amphtml,cory-work/amphtml,zhangsu/amphtml,tlong2/amphtml,mhc-gh/amphtml,media-net/amphtml,honeybadgerdontcare/amphtml,tlong2/amphtml,dotandads/amphtml,alanorozco/amphtml,danielrozenberg/amphtml,zhouyx/amphtml,yandex-pcode/amphtml,dotandads/amphtml,dotandads/amphtml,prateekbh/amphtml,Gregable/amphtml,Gregable/amphtml,voyagegroup/amphtml,jridgewell/amphtml,ampproject/amphtml,tlong2/amphtml,adup-tech/amphtml,yandex-pcode/amphtml,jridgewell/amphtml,voyagegroup/amphtml,jridgewell/amphtml,lannka/amphtml,erwinmombay/amphtml,yandex-pcode/amphtml,jpettitt/amphtml,jmadler/amphtml,sharethrough/amphtml,nexxtv/amphtml,honeybadgerdontcare/amphtml,prateekbh/amphtml,jridgewell/amphtml,danielrozenberg/amphtml,erwinmombay/amphtml,jpettitt/amphtml,taboola/amphtml,lannka/amphtml,nexxtv/amphtml,media-net/amphtml,nexxtv/amphtml,smartadserver/amphtml,Gregable/amphtml,taboola/amphtml,rsimha-amp/amphtml,jpettitt/amphtml,Gregable/amphtml,sharethrough/amphtml,danielrozenberg/amphtml,yandex-pcode/amphtml,honeybadgerdontcare/amphtml,dotandads/amphtml,taboola/amphtml,smartadserver/amphtml,adup-tech/amphtml,prateekbh/amphtml,dotandads/amphtml,jmadler/amphtml,rsimha-amp/amphtml,lannka/amphtml,erwinmombay/amphtml,jmadler/amphtml,ampproject/amphtml,zhouyx/amphtml,adup-tech/amphtml,zhouyx/amphtml,voyagegroup/amphtml,tlong2/amphtml,ampproject/amphtml,mhc-gh/amphtml,honeybadgerdontcare/amphtml,cory-work/amphtml,voyagegroup/amphtml,media-net/amphtml,mhc-gh/amphtml,alanorozco/amphtml,cory-work/amphtml,mhc-gh/amphtml,alanorozco/amphtml,nexxtv/amphtml,zhangsu/amphtml,cory-work/amphtml,danielrozenberg/amphtml,mhc-gh/amphtml,alanorozco/amphtml,zhangsu/amphtml,Gregable/amphtml,jpettitt/amphtml,rsimha-amp/amphtml