fixed araqne/issue#396. fixed join query hang (corrupted by race condition)