Turns out I missed a problem with this. When queues are shut down, releasing result object reenters sample release method, and potentially destroys it. On return original call continues, and uses critical section that has been just destroyed.
Attaching a possible fix for this.
[2.diff](/uploads/94a959648e483587b11172a6cc34b015/2.diff)