Avoid potential race while fetching a replication lag value