Joins JavaScript's asynchronous calls together similar to how `pthread_join` works for threads.