Your code is very confusing. I don't understand what you're doing, and by the looks of it I'm pretty sure neither do you. Try covering your code with asserts and unit tests, I'll bet a lot of things do not match up with your assumptions.
Also it would have been better to provide a minimal compilable version of your program.
As for your problem, someone who is feeling belligerent may ask you "well if the problem is fixed by using vsync, why don't you just use vsync?" and I would be interested to see how you answer them.