Cherry-pick some upstream speed-ups in mutter

Part of endlessm/eos-shell#3578.