Auto merge of #6917 - Ms2ger:lock-alert, r=metajack
Auto merge of #6917 - Ms2ger:lock-alert, r=metajack

Lock and flush stdout in Window#alert.

We use alert() to communicate test results to wptrunner. Unfortunately,
sometimes the alert output is interleaved with other output on stdout,
causing wptrunner to classify the test result as a timeout. I hope this will
avoid that scenario.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6917)
<!-- Reviewable:end -->

dagnir/servo,bjwbell/servo,peterjoel/servo,youprofit/servo,avadacatavra/servo,KiChjang/servo,pyfisch/servo,GyrosOfWar/servo,caldwell/servo,steveklabnik/servo,notriddle/servo,aidanhs/servo,szeged/servo,notriddle/servo,mbrubeck/servo,walac/servo,upsuper/servo,notriddle/servo,saratang/servo,tafia/servo,splav/servo,notriddle/servo,notriddle/servo,aidanhs/servo,nnethercote/servo,huonw/servo,cbrewster/servo,emilio/servo,s142857/servo,SimonSapin/servo,dati91/servo,avadacatavra/servo,pyfisch/servo,paulrouget/servo,huonw/servo,nnethercote/servo,meh/servo,wartman4404/servo,peterjoel/servo,kindersung/servo,nrc/servo,g-k/servo,sadmansk/servo,saratang/servo,dvberkel/servo,dvberkel/servo,rnestler/servo,tafia/servo,dagnir/servo,dvberkel/servo,eddyb/servo,paulrouget/servo,runarberg/servo,nerith/servo,codemac/servo,caldwell/servo,akosel/servo,dhananjay92/servo,KiChjang/servo,saneyuki/servo,steveklabnik/servo,anthgur/servo,nnethercote/servo,g-k/servo,peterjoel/servo,youprofit/servo,thiagopnts/servo,jimberlage/servo,dhananjay92/servo,ConnorGBrewster/servo,SimonSapin/servo,dsandeephegde/servo,nick-thompson/servo,s142857/servo,larsbergstrom/servo,dsandeephegde/servo,CJ8664/servo,AnthonyBroadCrawford/servo,dsandeephegde/servo,DominoTree/servo,rnestler/servo,thiagopnts/servo,bjwbell/servo,vks/servo,kindersung/servo,szeged/servo,szeged/servo,g-k/servo,saneyuki/servo,youprofit/servo,KiChjang/servo,tafia/servo,brendandahl/servo,larsbergstrom/servo,sadmansk/servo,huonw/servo,nnethercote/servo,g-k/servo,avadacatavra/servo,avadacatavra/servo,KiChjang/servo,rnestler/servo,larsbergstrom/servo,larsbergstrom/servo,KiChjang/servo,eddyb/servo,notriddle/servo,codemac/servo,emilio/servo,codemac/servo,boghison/servo,CJ8664/servo,dagnir/servo,s142857/servo,bjwbell/servo,KiChjang/servo,nrc/servo,KiChjang/servo,splav/servo,dagnir/servo,WriterOfAlicrow/servo,zentner-kyle/servo,RenaudParis/servo,nrc/servo,tempbottle/servo,nerith/servo,AnthonyBroadCrawford/servo,steveklabnik/servo,canaltinova/servo,codemac/servo,jimberlage/servo,GyrosOfWar/servo,bjwbell/servo,dati91/servo,dati91/servo,paulrouget/servo,meh/servo,anthgur/servo,thiagopnts/servo,nnethercote/servo,canaltinova/servo,eddyb/servo,DominoTree/servo,wartman4404/servo,boghison/servo,avadacatavra/servo,nick-thompson/servo,aidanhs/servo,sadmansk/servo,s142857/servo,mdibaiee/servo,runarberg/servo,A-deLuna/servo,youprofit/servo,A-deLuna/servo,dhananjay92/servo,cbrewster/servo,fiji-flo/servo,rentongzhang/servo,kindersung/servo,mattnenterprise/servo,j3parker/servo,mdibaiee/servo,SimonSapin/servo,nerith/servo,jdramani/servo,boghison/servo,vks/servo,jlegendary/servo,canaltinova/servo,sadmansk/servo,anthgur/servo,tafia/servo,splav/servo,nrc/servo,DominoTree/servo,wartman4404/servo,j3parker/servo,meh/servo,jlegendary/servo,larsbergstrom/servo,DominoTree/servo,tempbottle/servo,mbrubeck/servo,kindersung/servo,RenaudParis/servo,tempbottle/servo,zentner-kyle/servo,wartman4404/servo,paulrouget/servo,thiagopnts/servo,GyrosOfWar/servo,DominoTree/servo,notriddle/servo,CJ8664/servo,pyfisch/servo,bjwbell/servo,CJ8664/servo,caldwell/servo,steveklabnik/servo,KiChjang/servo,jimberlage/servo,mattnenterprise/servo,rnestler/servo,tempbottle/servo,notriddle/servo,jdramani/servo,nrc/servo,SimonSapin/servo,caldwell/servo,steveklabnik/servo,akosel/servo,bjwbell/servo,upsuper/servo,akosel/servo,upsuper/servo,dati91/servo,zentner-kyle/servo,dati91/servo,KiChjang/servo,nnethercote/servo,ConnorGBrewster/servo,nerith/servo,vks/servo,jdramani/servo,nerith/servo,emilio/servo,larsbergstrom/servo,nrc/servo,DominoTree/servo,steveklabnik/servo,mdibaiee/servo,nick-thompson/servo,jlegendary/servo,peterjoel/servo,dagnir/servo,saneyuki/servo,g-k/servo,RenaudParis/servo,ConnorGBrewster/servo,eddyb/servo,pyfisch/servo,dagnir/servo,splav/servo,aidanhs/servo,avadacatavra/servo,codemac/servo,anthgur/servo,avadacatavra/servo,meh/servo,nick-thompson/servo,cbrewster/servo,WriterOfAlicrow/servo,codemac/servo,mattnenterprise/servo,nrc/servo,paulrouget/servo,nerith/servo,dsandeephegde/servo,dvberkel/servo,nick-thompson/servo,s142857/servo,cbrewster/servo,fiji-flo/servo,jdramani/servo,jlegendary/servo,jdramani/servo,youprofit/servo,fiji-flo/servo,paulrouget/servo,A-deLuna/servo,rentongzhang/servo,dsandeephegde/servo,anthgur/servo,SimonSapin/servo,tempbottle/servo,jimberlage/servo,larsbergstrom/servo,j3parker/servo,bjwbell/servo,dhananjay92/servo,pyfisch/servo,s142857/servo,nnethercote/servo,mbrubeck/servo,brendandahl/servo,fiji-flo/servo,szeged/servo,nerith/servo,emilio/servo,walac/servo,paulrouget/servo,brendandahl/servo,sadmansk/servo,saneyuki/servo,runarberg/servo,anthgur/servo,CJ8664/servo,A-deLuna/servo,caldwell/servo,DominoTree/servo,canaltinova/servo,zentner-kyle/servo,larsbergstrom/servo,runarberg/servo,jimberlage/servo,caldwell/servo,larsbergstrom/servo,SimonSapin/servo,akosel/servo,notriddle/servo,nick-thompson/servo,aidanhs/servo,cbrewster/servo,paulrouget/servo,canaltinova/servo,rnestler/servo,AnthonyBroadCrawford/servo,tafia/servo,meh/servo,upsuper/servo,GyrosOfWar/servo,youprofit/servo,rnestler/servo,mattnenterprise/servo,kindersung/servo,WriterOfAlicrow/servo,canaltinova/servo,DominoTree/servo,fiji-flo/servo,cbrewster/servo,mdibaiee/servo,dati91/servo,emilio/servo,g-k/servo,canaltinova/servo,jlegendary/servo,szeged/servo,runarberg/servo,cbrewster/servo,wartman4404/servo,dati91/servo,mattnenterprise/servo,upsuper/servo,mattnenterprise/servo,CJ8664/servo,meh/servo,eddyb/servo,caldwell/servo,sadmansk/servo,dsandeephegde/servo,CJ8664/servo,dvberkel/servo,WriterOfAlicrow/servo,vks/servo,mbrubeck/servo,splav/servo,splav/servo,runarberg/servo,youprofit/servo,nnethercote/servo,codemac/servo,thiagopnts/servo,larsbergstrom/servo,jlegendary/servo,szeged/servo,tempbottle/servo,fiji-flo/servo,mattnenterprise/servo,ConnorGBrewster/servo,sadmansk/servo,sadmansk/servo,szeged/servo,akosel/servo,vks/servo,saneyuki/servo,cbrewster/servo,WriterOfAlicrow/servo,huonw/servo,peterjoel/servo,dhananjay92/servo,WriterOfAlicrow/servo,mdibaiee/servo,DominoTree/servo,rentongzhang/servo,splav/servo,saratang/servo,boghison/servo,mdibaiee/servo,szeged/servo,brendandahl/servo,rentongzhang/servo,meh/servo,saratang/servo,kindersung/servo,rentongzhang/servo,boghison/servo,emilio/servo,akosel/servo,saratang/servo,jimberlage/servo,jimberlage/servo,j3parker/servo,dvberkel/servo,walac/servo,thiagopnts/servo,dsandeephegde/servo,jimberlage/servo,brendandahl/servo,SimonSapin/servo,aidanhs/servo,jdramani/servo,upsuper/servo,vks/servo,rentongzhang/servo,A-deLuna/servo,anthgur/servo,rnestler/servo,akosel/servo,WriterOfAlicrow/servo,saratang/servo,s142857/servo,g-k/servo,j3parker/servo,ConnorGBrewster/servo,rnestler/servo,brendandahl/servo,AnthonyBroadCrawford/servo,mdibaiee/servo,DominoTree/servo,saneyuki/servo,tempbottle/servo,rentongzhang/servo,walac/servo,saneyuki/servo,emilio/servo,tafia/servo,jdramani/servo,dhananjay92/servo,saneyuki/servo,boghison/servo,canaltinova/servo,mbrubeck/servo,SimonSapin/servo,anthgur/servo,RenaudParis/servo,eddyb/servo,emilio/servo,huonw/servo,saratang/servo,RenaudParis/servo,mbrubeck/servo,j3parker/servo,saneyuki/servo,zentner-kyle/servo,emilio/servo,AnthonyBroadCrawford/servo,kindersung/servo,RenaudParis/servo,pyfisch/servo,AnthonyBroadCrawford/servo,wartman4404/servo,thiagopnts/servo,pyfisch/servo,paulrouget/servo,walac/servo,GyrosOfWar/servo,boghison/servo,nick-thompson/servo,zentner-kyle/servo,splav/servo,walac/servo,nnethercote/servo,RenaudParis/servo,zentner-kyle/servo,dati91/servo,fiji-flo/servo,A-deLuna/servo,ConnorGBrewster/servo,huonw/servo,splav/servo,emilio/servo,mbrubeck/servo,upsuper/servo,dhananjay92/servo,upsuper/servo,KiChjang/servo,szeged/servo,szeged/servo,peterjoel/servo,nnethercote/servo,dvberkel/servo,ConnorGBrewster/servo,GyrosOfWar/servo,eddyb/servo,eddyb/servo,CJ8664/servo,steveklabnik/servo,pyfisch/servo,A-deLuna/servo,wartman4404/servo,notriddle/servo,jimberlage/servo,dsandeephegde/servo,peterjoel/servo,huonw/servo,AnthonyBroadCrawford/servo,mbrubeck/servo,peterjoel/servo,vks/servo,paulrouget/servo,fiji-flo/servo,avadacatavra/servo,j3parker/servo,brendandahl/servo,tafia/servo,jlegendary/servo,GyrosOfWar/servo,aidanhs/servo,saneyuki/servo,thiagopnts/servo,peterjoel/servo,peterjoel/servo,splav/servo,pyfisch/servo,runarberg/servo,dagnir/servo,walac/servo,ConnorGBrewster/servo,pyfisch/servo,mattnenterprise/servo