Force a reflow after adding a stylesheet

This fixes a race (exposed in some reftests by #3563) where the document's
first paint happens before the stylesheet is added, and it never updates
after the stylesheet loads.

r? @jdm