(GH-571) Use process id instead of name

When waiting for a process to exit, use the id of the process as name may cause
errors if the name if is incorrect versus the actual process name. ID is
deterministic so should have less chance for error.