backup: Only delete repositories missing from a restore (re-attempt)
This is a second attempt at !6579 (merged), which had to be reverted last week as it caused Rails spec failures. See this Slack thread for more context.
This MR re-applies the commits from the original change, and also incorporates bug fixes from this follow-up MR (which can now be closed in favour of this).
Edited by James Liu