Cleanup failed pids as their fds/pipe are already closed. #7037
Declare failed_keys before use
Merge remote-tracking branch 'origin/v3/7037-fixspaces' into branch_v3_2