CSM update for OP-3997

Merging commits from upstream and tweaking the code so it resets the socket every 60 seconds, in order to help the load balancer distribute connections among the backends more evenly.