Fix bug where `/sync` requests could get blocked indefinitely after an upgrade from Synapse versions before v1.109.0.