Try to make the smpi-mpich-env test more robust in multitasking environments.

Only select the processes that share the same session ID.