MDL-37312 backup: Keep course idnumber on same site course restore

When the course idnumber is set during a same site course restore,
retain the course idnumber if there are no duplicates.