Fixed #21430 -- Warning raised when unpickling Models and QuerySet from different versions.

Thanks prasoon2211 for initial patch.

Thanks akaariai, loic, charettes for helping in shaping the patch.