fix TOCTOU interrupt race
The previous code was subject to a TOCTOU race: the atomic.AddInt32 in the select statement could succeed, but then context switch away before actually calling c.interrupt. The actual call to c.interrupt could end up occurring later, interrupting an unrelated subsequent query.
Fixes #241 (closed)
I should note that there are other, subsequent reads of done that are not protected by the mutex. I've mostly convinced myself that this is OK, but it'd be good for someone with more experience with this code to confirm. Worst case, we can pass in both a mutex and a *int32 and use the mutex everywhere.
Also, I have exactly zero attachment to this commit going in. Feel free to just fix yourself directly another way if that is easier! I just want it to be fixed. :)