Address some replication test failures due to cluster race conditions

Change some of the helper functions in the repl_util module to handle
errors more sensibly so that cluster setup race conditions do not
cause unnecessary test failures.
Merge branch 'bugfix/repl-util-race-fixes'