mongo-sync: Add caching to _is_master().
mongo-sync: Add caching to _is_master().

With _is_master() caching the primary node and the contents of hosts
(if available), _connect_to_master() can make use of that.

algernon/libmongo-client,algernon/libmongo-client,algernon/libmongo-client