More robust wait_for_backup [ci skip]