[tor-commits] [tor/master] Split the socketpair replacement code into its own function for testing