Auto merge of #19517 - mbrubeck:uluru, r=emilio
Auto merge of #19517 - mbrubeck:uluru, r=emilio

Defend against bugs in SelectorFlagsMap

Some defensive programming:

* Make `SelectorFlagsMap::apply_flags` private so it's easier to ensure it is called from the correct thread.

* Clear the cache and the map at the same time; otherwise `apply_flags` leaves `SelectorFlagsMap` in an inconsistent state.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they do not change behavior

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19517)
<!-- Reviewable:end -->

larsbergstrom/servo,avadacatavra/servo,upsuper/servo,szeged/servo,jimberlage/servo,jimberlage/servo,DominoTree/servo,pyfisch/servo,emilio/servo,pyfisch/servo,SimonSapin/servo,larsbergstrom/servo,rnestler/servo,nnethercote/servo,nnethercote/servo,pyfisch/servo,sadmansk/servo,larsbergstrom/servo,dati91/servo,nnethercote/servo,anthgur/servo,saneyuki/servo,fiji-flo/servo,paulrouget/servo,emilio/servo,emilio/servo,nnethercote/servo,saneyuki/servo,anthgur/servo,paulrouget/servo,saneyuki/servo,peterjoel/servo,canaltinova/servo,jimberlage/servo,KiChjang/servo,DominoTree/servo,dati91/servo,dati91/servo,anthgur/servo,sadmansk/servo,fiji-flo/servo,DominoTree/servo,jimberlage/servo,thiagopnts/servo,DominoTree/servo,paulrouget/servo,mattnenterprise/servo,canaltinova/servo,avadacatavra/servo,fiji-flo/servo,larsbergstrom/servo,DominoTree/servo,CJ8664/servo,pyfisch/servo,peterjoel/servo,thiagopnts/servo,mbrubeck/servo,avadacatavra/servo,KiChjang/servo,nnethercote/servo,mattnenterprise/servo,emilio/servo,cbrewster/servo,canaltinova/servo,CJ8664/servo,szeged/servo,nnethercote/servo,rnestler/servo,thiagopnts/servo,thiagopnts/servo,mbrubeck/servo,rnestler/servo,emilio/servo,ConnorGBrewster/servo,dati91/servo,anthgur/servo,mbrubeck/servo,avadacatavra/servo,larsbergstrom/servo,szeged/servo,jimberlage/servo,emilio/servo,peterjoel/servo,mattnenterprise/servo,SimonSapin/servo,cbrewster/servo,KiChjang/servo,jimberlage/servo,rnestler/servo,jimberlage/servo,dati91/servo,larsbergstrom/servo,ConnorGBrewster/servo,sadmansk/servo,mattnenterprise/servo,splav/servo,DominoTree/servo,dati91/servo,upsuper/servo,rnestler/servo,splav/servo,saneyuki/servo,ConnorGBrewster/servo,rnestler/servo,cbrewster/servo,CJ8664/servo,KiChjang/servo,szeged/servo,splav/servo,SimonSapin/servo,anthgur/servo,szeged/servo,cbrewster/servo,thiagopnts/servo,CJ8664/servo,notriddle/servo,paulrouget/servo,saneyuki/servo,szeged/servo,jimberlage/servo,avadacatavra/servo,nnethercote/servo,szeged/servo,canaltinova/servo,jimberlage/servo,notriddle/servo,CJ8664/servo,avadacatavra/servo,paulrouget/servo,upsuper/servo,canaltinova/servo,splav/servo,DominoTree/servo,nnethercote/servo,KiChjang/servo,szeged/servo,fiji-flo/servo,splav/servo,mbrubeck/servo,DominoTree/servo,peterjoel/servo,pyfisch/servo,notriddle/servo,rnestler/servo,cbrewster/servo,ConnorGBrewster/servo,avadacatavra/servo,larsbergstrom/servo,canaltinova/servo,saneyuki/servo,SimonSapin/servo,mbrubeck/servo,upsuper/servo,paulrouget/servo,fiji-flo/servo,KiChjang/servo,sadmansk/servo,emilio/servo,notriddle/servo,mattnenterprise/servo,KiChjang/servo,pyfisch/servo,anthgur/servo,dati91/servo,DominoTree/servo,notriddle/servo,sadmansk/servo,pyfisch/servo,canaltinova/servo,DominoTree/servo,avadacatavra/servo,mattnenterprise/servo,peterjoel/servo,mattnenterprise/servo,szeged/servo,szeged/servo,ConnorGBrewster/servo,larsbergstrom/servo,saneyuki/servo,pyfisch/servo,thiagopnts/servo,mbrubeck/servo,sadmansk/servo,larsbergstrom/servo,SimonSapin/servo,upsuper/servo,fiji-flo/servo,cbrewster/servo,cbrewster/servo,fiji-flo/servo,saneyuki/servo,CJ8664/servo,splav/servo,splav/servo,thiagopnts/servo,peterjoel/servo,upsuper/servo,paulrouget/servo,splav/servo,KiChjang/servo,mbrubeck/servo,emilio/servo,upsuper/servo,cbrewster/servo,notriddle/servo,canaltinova/servo,SimonSapin/servo,notriddle/servo,rnestler/servo,dati91/servo,peterjoel/servo,mattnenterprise/servo,nnethercote/servo,ConnorGBrewster/servo,KiChjang/servo,CJ8664/servo,notriddle/servo,ConnorGBrewster/servo,notriddle/servo,emilio/servo,sadmansk/servo,sadmansk/servo,thiagopnts/servo,mbrubeck/servo,anthgur/servo,splav/servo,peterjoel/servo,saneyuki/servo,larsbergstrom/servo,splav/servo,saneyuki/servo,CJ8664/servo,nnethercote/servo,paulrouget/servo,notriddle/servo,peterjoel/servo,paulrouget/servo,anthgur/servo,upsuper/servo,fiji-flo/servo,peterjoel/servo,SimonSapin/servo,SimonSapin/servo,pyfisch/servo,KiChjang/servo,emilio/servo,ConnorGBrewster/servo,paulrouget/servo,pyfisch/servo