pthread: Make pthread barriers 2LS-independent