Fix multithreaded qoi derivative assembly

After actually figuring out what this bug was, I'm not surprised it
broke adjoints_ex5 with threading; what I can't figure out is why it
didn't break adjoints examples 1-4.