Close tcp sockets upon exec

(cherry picked from commit open-mpi/ompi@6c4d5a51c44a4634241f7bafcb3630bf0b751e13)