Fixed #22275: unique_together broken if ForeignKey split into new file.

Thanks to bak1an for the patch.