Clear the viewmodel change queue after each full turn of the event loop

@Rich-Harris has another fix and I'm not sure that this is the best way to handle it, but I figured I'd put it out there as it's pretty simple and doesn't fail any tests or mess with caching logic.

Fixes #1364