Main process waits for the workers to exit.