MB-7657: avoid over flushing database update msgs

Today in some use cases when the load is small, it is possible
that we run into a race condition that src_db_updated msg from
couchdb is flushed before the replicator is able to capture it.

This fix adds two defense lines, 1) when in idling,  it only flushes
udpate msg when it is waken up and asks for token, 2) send itself an
update msg when processing checkpoint in idling state, that means
even when the idling replicator misses some update msgs, it will
wake up and check if any updates to replicate at checkpoint interval.
Today the default checkpoint interval is 30 min, so the performance
overhead is minimal.

Change-Id: I33319365f7b1bedc1620bb6e34653908302301d0