Fix https://bugs.freedesktop.org/109364 (switching vsync on and off in vkquake breaks TearFree)
The first patch fixes a related issue discovered when trying to reproduce the bug with warzone2100.
The second patch fixes the bug reported in bugzilla.
The third patch fixes another related issue I noticed while working on the second patch.
Edited by Michel Dänzer