Fix #429: Replication relay crash with background=true
Merge remote-tracking branch 'origin/gh-429-replication-crash-background'