MDL-38189 Backup/restore: Backport of Moodle 2.6 backup/restore reliability fixes