Add `pthread_barrier_*` functions

Compare [`pthread_barrier_init()`][1].

Based on #728. Will rebase once this PR is merged.

  [1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_barrier_init.html