Initial effort for getting rid of qt deadlock

Deadlock in a couple of tests is occurring because the main task is waiting for
a sync var to have a certain value and other tasks that are incrementing that
value aren't getting a chance to run because the main task is never yielding.
This adds it so that every 256 unlocks of a sync var the task yields. 256 is
just an initial guess. 32 seems to spend too much time in task switching so I'm
trying 256. This number may be refined further.