add barriers in qthread plugin in allocate/deallocate