Add a socket timeout option. Default to 100 ms.

This way, if isMaster() takes too long to execute on a replica,
overall timing collection is not affected.