Implement a_swap and a_fetch_add for internal musl libc atomics for the JS arch.
Fix typo in previous commit.
Add pthread barrier API from musl.
Add test for pthread barriers.