Fix a race condition in nailgun_task.py
Fix a race condition in nailgun_task.py

When forking to spawn a ng daemon, and writing the pidfile, it was possible
for the append of the port number (by the parent) to precede the writing
of the pid (by the child). The child would then overwrite the port number,
leaving an invalid pidfile.

Auditors: markcc

(sapling split of 763265571c9ea9694366e2e5378241b73719a6ce)
ity/pants,UnrememberMe/pants,cevaris/pants,lahosken/pants,ity/pants,15Dkatz/pants,landism/pants,slyphon/pants,dturner-tw/pants,kwlzn/pants,twitter/pants,tdyas/pants,areitz/pants,fkorotkov/pants,megaserg/pants,UnrememberMe/pants,kslundberg/pants,dbentley/pants,gmalmquist/pants,scode/pants,landism/pants,kwlzn/pants,sid-kap/pants,slyphon/pants,pombredanne/pants,scode/pants,tdyas/pants,slyphon/pants,slyphon/pants,ericzundel/pants,jtrobec/pants,dgomez10/xanon,wisechengyi/pants,dbentley/pants,foursquare/pants,15Dkatz/pants,di0spyr0s/pants,dturner-tw/pants,twitter/pants,megaserg/pants,Gabriel439/pants,landism/pants,sid-kap/pants,jtrobec/pants,15Dkatz/pants,megaserg/pants,TansyArron/pants,di0spyr0s/pants,tdyas/pants,pombredanne/pants,peiyuwang/pants,benjyw/pants,Gabriel439/pants,sameerparekh/pants,jtrobec/pants,manasapte/pants,tejal29/pants,sameerparekh/pants,dgomez10/xanon,cevaris/pants,slyphon/pants,kslundberg/pants,laurentgo/pants,15Dkatz/pants,dgomez10/xanon,15Dkatz/pants,scode/pants,ericzundel/pants,di0spyr0s/pants,ity/pants,twitter/pants,jessrosenfield/pants,peiyuwang/pants,cevaris/pants,dbentley/pants,Gabriel439/pants,pantsbuild/pants,sid-kap/pants,Gabriel439/pants,fkorotkov/pants,pombredanne/pants,jessrosenfield/pants,di0spyr0s/pants,jessrosenfield/pants,jessrosenfield/pants,dgomez10/xanon,megaserg/pants,gmalmquist/pants,peiyuwang/pants,benjyw/pants,pgroudas/pants,foursquare/pants,dturner-tw/pants,jessrosenfield/pants,pantsbuild/pants,sid-kap/pants,mateor/pants,ericzundel/pants,baroquebobcat/pants,15Dkatz/pants,jessrosenfield/pants,cevaris/pants,gmalmquist/pants,pgroudas/pants,kslundberg/pants,foursquare/pants,lahosken/pants,lahosken/pants,dgomez10/xanon,jtrobec/pants,jtrobec/pants,twitter/pants,landism/pants,pombredanne/pants,kslundberg/pants,gmalmquist/pants,qma/pants,fkorotkov/pants,landism/pants,tdyas/pants,twitter/pants,di0spyr0s/pants,benjyw/pants,baroquebobcat/pants,pantsbuild/pants,kwlzn/pants,fkorotkov/pants,fkorotkov/pants,manasapte/pants,fkorotkov/pants,sameerparekh/pants,mateor/pants,dgomez10/xanon,megaserg/pants,sid-kap/pants,ity/pants,ity/pants,wisechengyi/pants,gmalmquist/pants,kwlzn/pants,dbentley/pants,wisechengyi/pants,lahosken/pants,manasapte/pants,foursquare/pants,dgomez10/xanon,pantsbuild/pants,UnrememberMe/pants,dbentley/pants,digwanderlust/pants,gmalmquist/pants,peiyuwang/pants,dturner-tw/pants,pantsbuild/pants,tejal29/pants,qma/pants,fkorotkov/pants,digwanderlust/pants,twitter/pants,landism/pants,slyphon/pants,gmalmquist/pants,manasapte/pants,wisechengyi/pants,baroquebobcat/pants,jsirois/pants,di0spyr0s/pants,peiyuwang/pants,baroquebobcat/pants,qma/pants,mateor/pants,peiyuwang/pants,dturner-tw/pants,dbentley/pants,UnrememberMe/pants,foursquare/pants,landism/pants,ericzundel/pants,scode/pants,ericzundel/pants,sameerparekh/pants,square/pants,ity/pants,foursquare/pants,kslundberg/pants,scode/pants,UnrememberMe/pants,15Dkatz/pants,tdyas/pants,foursquare/pants,pgroudas/pants,foursquare/pants,tdyas/pants,dturner-tw/pants,mateor/pants,qma/pants,lahosken/pants,mateor/pants,benjyw/pants,digwanderlust/pants,baroquebobcat/pants,fkorotkov/pants,areitz/pants,dbentley/pants,twitter/pants,mateor/pants,tejal29/pants,foursquare/pants,pantsbuild/pants,UnrememberMe/pants,megaserg/pants,sameerparekh/pants,manasapte/pants,wisechengyi/pants,cevaris/pants,jsirois/pants,twitter/pants,peiyuwang/pants,tdyas/pants,scode/pants,qma/pants,manasapte/pants,lahosken/pants,Gabriel439/pants,baroquebobcat/pants,kslundberg/pants,ericzundel/pants,pombredanne/pants,mateor/pants,landism/pants,tdyas/pants,laurentgo/pants,TansyArron/pants,tejal29/pants,kslundberg/pants,ity/pants,kwlzn/pants,dgomez10/xanon,digwanderlust/pants,qma/pants,jessrosenfield/pants,dturner-tw/pants,manasapte/pants,wisechengyi/pants,sameerparekh/pants,TansyArron/pants,ericzundel/pants,TansyArron/pants,wisechengyi/pants,peiyuwang/pants,wisechengyi/pants,laurentgo/pants,pgroudas/pants,tdyas/pants,15Dkatz/pants,TansyArron/pants,cevaris/pants,lahosken/pants,mateor/pants,areitz/pants,wisechengyi/pants,TansyArron/pants,twitter/pants,TansyArron/pants,kwlzn/pants,laurentgo/pants,areitz/pants,jtrobec/pants,square/pants,slyphon/pants,digwanderlust/pants,scode/pants,areitz/pants,pgroudas/pants,benjyw/pants,areitz/pants,lahosken/pants,Gabriel439/pants,sid-kap/pants,baroquebobcat/pants,Gabriel439/pants,baroquebobcat/pants,pombredanne/pants,cevaris/pants,sid-kap/pants,digwanderlust/pants,ericzundel/pants,laurentgo/pants,megaserg/pants,kwlzn/pants,square/pants,benjyw/pants,pgroudas/pants,sameerparekh/pants,benjyw/pants,jtrobec/pants,baroquebobcat/pants,di0spyr0s/pants,tejal29/pants,dgomez10/xanon,laurentgo/pants,dgomez10/xanon,square/pants,qma/pants,UnrememberMe/pants,dgomez10/xanon,pantsbuild/pants,UnrememberMe/pants,jsirois/pants,areitz/pants,pombredanne/pants,UnrememberMe/pants