librados: only call watch_flush if necessary

Fix bug #10424
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Merge pull request #3243 from yuyuyu101/wip-10424

librados: only call watch_flush if necessary

Reviewed-by: Loic Dachary <ldachary@redhat.com>