Wait only for the right process to finish on *nix. Closes #646