If using the suid sandbox, but not using the seccomp sandbox, there is a good chance that we will produce a zombie process inside of the new pid namespace. This happens, because we create a short-lived helper process when setting up the pid namespace, but the new "init" process never gets around to reaping this process.
If using the suid sandbox, but not using the seccomp sandbox, there is a
good chance that we will produce a zombie process inside of the new
pid namespace. This happens, because we create a short-lived helper
process when setting up the pid namespace, but the new "init" process
never gets around to reaping this process.

It would have reaped it, if it had received a SIGCHLD signal from any
other process that died. But without the seccomp sandbox, that doesn't
happen very frequently.

This changelist reorders instructions so that we always look for dead
children at least once, when starting the mainloop of the new "init"
process. In doing so, we will always find and reap our dead helper
process.

BUG=109944
TEST=Run Chrome with the suid but without the seccomp sandbox, grep for "defunct" processes in the output of "ps auxw". There shouldn't be any.
Review URL: https://chromiumcodereview.appspot.com/9661001

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@126188 0039d316-1c4b-4281-b951-d872f2087c98

ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,littlstar/chromium.src,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,krieger-od/nwjs_chromium.src,mogoweb/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Just-D/chromium-1,rogerwang/chromium,anirudhSK/chromium,chuan9/chromium-crosswalk,keishi/chromium,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk,hujiajie/pa-chromium,Jonekee/chromium.src,robclark/chromium,ondra-novak/chromium.src,Chilledheart/chromium,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,krieger-od/nwjs_chromium.src,robclark/chromium,littlstar/chromium.src,dushu1203/chromium.src,ltilve/chromium,nacl-webkit/chrome_deps,zcbenz/cefode-chromium,fujunwei/chromium-crosswalk,dednal/chromium.src,dednal/chromium.src,pozdnyakov/chromium-crosswalk,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,axinging/chromium-crosswalk,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,anirudhSK/chromium,ondra-novak/chromium.src,Just-D/chromium-1,ChromiumWebApps/chromium,robclark/chromium,hgl888/chromium-crosswalk,Jonekee/chromium.src,keishi/chromium,robclark/chromium,ondra-novak/chromium.src,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,nacl-webkit/chrome_deps,jaruba/chromium.src,nacl-webkit/chrome_deps,markYoungH/chromium.src,M4sse/chromium.src,keishi/chromium,anirudhSK/chromium,anirudhSK/chromium,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,Just-D/chromium-1,markYoungH/chromium.src,keishi/chromium,rogerwang/chromium,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,krieger-od/nwjs_chromium.src,Just-D/chromium-1,Chilledheart/chromium,bright-sparks/chromium-spacewalk,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,junmin-zhu/chromium-rivertrail,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,jaruba/chromium.src,patrickm/chromium.src,Just-D/chromium-1,zcbenz/cefode-chromium,Jonekee/chromium.src,dushu1203/chromium.src,littlstar/chromium.src,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,dushu1203/chromium.src,anirudhSK/chromium,robclark/chromium,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,timopulkkinen/BubbleFish,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,chuan9/chromium-crosswalk,fujunwei/chromium-crosswalk,keishi/chromium,Pluto-tv/chromium-crosswalk,nacl-webkit/chrome_deps,jaruba/chromium.src,rogerwang/chromium,Fireblend/chromium-crosswalk,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,dednal/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,krieger-od/nwjs_chromium.src,Just-D/chromium-1,dednal/chromium.src,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,littlstar/chromium.src,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,TheTypoMaster/chromium-crosswalk,keishi/chromium,dednal/chromium.src,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,timopulkkinen/BubbleFish,chuan9/chromium-crosswalk,Just-D/chromium-1,ondra-novak/chromium.src,keishi/chromium,Jonekee/chromium.src,robclark/chromium,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,robclark/chromium,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,keishi/chromium,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,robclark/chromium,Just-D/chromium-1,M4sse/chromium.src,Chilledheart/chromium,timopulkkinen/BubbleFish,rogerwang/chromium,hujiajie/pa-chromium,hgl888/chromium-crosswalk-efl,ltilve/chromium,junmin-zhu/chromium-rivertrail,pozdnyakov/chromium-crosswalk,dednal/chromium.src,Fireblend/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,hujiajie/pa-chromium,rogerwang/chromium,anirudhSK/chromium,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,keishi/chromium,ondra-novak/chromium.src,hgl888/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,patrickm/chromium.src,nacl-webkit/chrome_deps,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,zcbenz/cefode-chromium,nacl-webkit/chrome_deps,robclark/chromium,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,M4sse/chromium.src,rogerwang/chromium,Chilledheart/chromium,keishi/chromium,junmin-zhu/chromium-rivertrail,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,ltilve/chromium,krieger-od/nwjs_chromium.src,littlstar/chromium.src,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,markYoungH/chromium.src,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,robclark/chromium,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,ltilve/chromium,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Jonekee/chromium.src,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,nacl-webkit/chrome_deps,timopulkkinen/BubbleFish,littlstar/chromium.src,patrickm/chromium.src,hujiajie/pa-chromium,markYoungH/chromium.src,hujiajie/pa-chromium,Fireblend/chromium-crosswalk,Jonekee/chromium.src,zcbenz/cefode-chromium,hgl888/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,ondra-novak/chromium.src,ondra-novak/chromium.src,ltilve/chromium,Just-D/chromium-1,hujiajie/pa-chromium,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,hujiajie/pa-chromium,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,ondra-novak/chromium.src,fujunwei/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,pozdnyakov/chromium-crosswalk,ondra-novak/chromium.src,zcbenz/cefode-chromium,jaruba/chromium.src,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,jaruba/chromium.src,timopulkkinen/BubbleFish,jaruba/chromium.src,crosswalk-project/chromium-crosswalk-efl,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,mogoweb/chromium-crosswalk,markYoungH/chromium.src,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,anirudhSK/chromium,Chilledheart/chromium,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,junmin-zhu/chromium-rivertrail,axinging/chromium-crosswalk,markYoungH/chromium.src,Fireblend/chromium-crosswalk,hujiajie/pa-chromium,rogerwang/chromium,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,dushu1203/chromium.src,M4sse/chromium.src,zcbenz/cefode-chromium,littlstar/chromium.src,Pluto-tv/chromium-crosswalk,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk,patrickm/chromium.src,chuan9/chromium-crosswalk,jaruba/chromium.src,rogerwang/chromium,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,ltilve/chromium,ltilve/chromium,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk,markYoungH/chromium.src,mogoweb/chromium-crosswalk,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,littlstar/chromium.src,rogerwang/chromium,mogoweb/chromium-crosswalk,M4sse/chromium.src,krieger-od/nwjs_chromium.src,jaruba/chromium.src,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,M4sse/chromium.src,Jonekee/chromium.src,junmin-zhu/chromium-rivertrail,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,dushu1203/chromium.src,anirudhSK/chromium,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,rogerwang/chromium,keishi/chromium,jaruba/chromium.src,Fireblend/chromium-crosswalk,Jonekee/chromium.src,fujunwei/chromium-crosswalk,mogoweb/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,ltilve/chromium,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,junmin-zhu/chromium-rivertrail,hujiajie/pa-chromium,dednal/chromium.src,patrickm/chromium.src,Chilledheart/chromium,Chilledheart/chromium