Fixed #21043 -- Made resolve() handle reverse_lazy objects.

Thanks Keryn Knight for the report.