add timeout parameter to connect function in TCPStore (#26554)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/26554
Previously, in `TCPStore`'s constructor we did not pass in a timeout to
the `connect` function, which thus used the default timeout (-1, so infinite).
But the timeout variable in `TCPStore.cpp `is configurable by the user and set to
be 300 seconds by default, so we should be passing this into the connect function.
Test Plan: see above.
Differential Revision: D17486779
fbshipit-source-id: 42d38a3b8d492d9e9ff09110990a8e4a3a1292b2